- 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-windows
and 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.0
runs, 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.0
and7.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
npm
folder - Go to this folder
%APPDATA%\nvm\v14.20.0\node_modules
- Rename the
npm
folder tonpm-6.14.17
as a backup - Paste in the
npm
folder copied from the16.10.0\node_modules
folder nvm use 14.20.0
-
node -v && npm -v
- Should give14.20.0
and7.24.0
Top comments (0)