I want to use an earlier version of node v14.7.0 and its respective npm. When I do that I still get the latest version of npm and not the earlier version.
How to get the earlier version?
CodePudding user response:
You can rollback to the old version of npm using the following command
npm install -g npm@<version number>
for example:
npm install -g [email protected]
if you want the latest version you can use:
@latest
instead of version number.
CodePudding user response:
When I do that I still get the latest version of npm and not the earlier version.
It could be due to not deleting it properly or you might be installing the latest version again.
I recommend you to use nvm if you are using a linux-based OS and nvm-windows for windows based systems. It will help you to keep different versions of node and npm and you can switch later based on the project requirements.
It is easy to install and use. Linux command:
nvm install node
For windows, you can install nvm-windows here.
nvm list
Once you do it, you can install different version of node and it will automatically give its associated npm version:
nvm install `versionnumber`