![]() ![]() Now, you can list available LTS versions to use with NVM nvm ls Let’s check first our system Node version: node -v However, by default NVM will not be on your system, to install it run: curl | bash Those who want to switch the Node version and use the corresponding version of NPM available for it can use the NVM (Node Version Manager) tool that facilitates us with a command to switch between different versions of Node.js and NPM. ![]() Now, if we want to get back the previous version that we have changed, we need to install it using the same command.įor example, we switch to NPM 6.14.5 and now want to go back to 9.5.0, then we use: npm install -g NVM Usage to switch Node version. ![]() You can see in the previous step we have successfully changed the current NPM version to what want. Step 4: Switch back to the previous NPM version This will display the newly installed version of NPM. In the above-given syntax, replace the ‘version_number‘ text with the exact version of NPM you want to install on your system.įor example, our current version is 9.5.0 but we need 6.14.5 for our project then to install it, we can use the “NPM Install” command in this way: npm install -g : -g stands for global, if you want to install the new version only for your current project then switch to its directory and run the command but without -g Step 3: Verify the new NPM versionĪfter successfully installing the NPM required version, we can check whether it has been set as the default current version or not. If you want to have some other version of NPM than the one currently installed on your system then you need to install it manually, here is the command syntax to do that. The above command will display the current NPM version installed on your system. ![]() To do that on your PC – Windows, Linux, or macOS open the command terminal, and after that run the given command. You should know the current version of NPM installed on your system before issuing any command to change it. Conclusion Step 1: Check the current NPM version ![]()
0 Comments
Leave a Reply. |