Upgrade or downgrade node and npm version with NVM
Hello folks! Hope you all are doing well. In the previous post, we learnt about the basic ubuntu commands. If you havent read that, then give it a try. Today, we learn how to upgrade or downgrade the node and npm version.
In some cases, the user requires a specific version of node. Suppose you have node of version 14.15.0 and for some task you need node version 12.0.0. In that case, you might think that you should uninstall the version you have and install the version that is required.
Rather than doing it manually, you can manage the node and the npm versions using nvm windows. NVM stands for node version manager. Just install the nvm for the windows os and then run the nvm commands on the terminal to manange the node verisons.
NOTE: As you switch to a new node version, its compatible npm version will be installed along with. So just get the required node version and the npm version will be managed respectivly.
Without any further due, lets get to the main point. So for this, go to any search engine and search nvm windows release.
1. Go to the first search result which is the official github repo of the nvm.
2. Then download the zip file of nvm under the assets section.
3. Unzip the file and install the nvm.exe file
4. After some basic installation steps, nvm will be installed on your device.
5. Open the git bash/ terminal, and check if nvm is properly installed with this command.
nvm -v
This command will give the installed version of nvm on your system.
NOTE: With the above command, some basic nvm commands will also be printed and by reading them, you will get a fair idea about the other useful commands to manage node version.
6. Then uninstall the node version you have with the command below. For this, you must know the exact version of your node app.
nvm uninstall 15.12.0
7. Then install the node version according to your environment using the command below.
nvm install 12.0.0
8. After this, use this command below to use the newly installed version on your system.
nvm use 12.0.0
This is it. NVM gets really helpful when you have to suddenly upgrade or downgrade the node and npm version. So finally you have achieved what you want to. If you like the post and if it helped you, make sure to share it with our friends.
Labels: NodeJS
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home