- If you have not installed a Node Version Manager, you might want to try Volta first, it may be easier than
nvm-windows - If you've already installed
nvm-windowsand don't want to rip it out to try something else (like me), then you'll find setting up different npm versions than what ships with Node to be quite annoying - Doing a simple
npm install -g npm@7.24.0runs, but fails. So here's the process to get this done:
Instructions
-
nvm install 14.20.0- The last release of v14 -
nvm install 16.10.0- Comes with the last released version of npm 7 (7.24.0)- Note: If you are following this guide for different Node/npm versions, it will work the same, just consult Node's releases docs for which versions to use for your use case
-
nvm use 16.10.0- This is so we can manipulate v14 while not running it globally -
node -v && npm -v- Should give16.10.0and7.24.0 - Go to this folder
%APPDATA%\nvm\v16.10.0\node_modules- Paste it into the Start Menu search > Enter
- or, WinKey + R > Paste > OK
- or, WinKey + E > Folder Path address bar > paste > enter
- Right-Click > Copy the
npmfolder - Go to this folder
%APPDATA%\nvm\v14.20.0\node_modules - Rename the
npmfolder tonpm-6.14.17as a backup - Paste in the
npmfolder copied from the16.10.0\node_modulesfolder nvm use 14.20.0-
node -v && npm -v- Should give14.20.0and7.24.0
Top comments (0)