My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping


Monday, October 12, 2020

Using different Versions of Node using NVM

 To check your current active version of Node and NPM

node -v
npm -v

Node 10.7.0

Node is most easily managed using NVM and that is the recommended tool we suggest.

Now, suppose you have different version of node installed, but some app needs a lower or a different version. Then what to do. Here comes nvm for the rescue!

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.

Install & Update Script

To install or update nvm, you should run the install script. To do that, you may either download and run the script manually, or use the following cURL or Wget command:

curl -o- | bash

Do not forget to source the bash profile after this:

Simply type source ~/.bash_profile

Alternatively, if you like saving keystrokes you can type . ~/.bash_profile

Now you can use nvm commands to change node version


nvm install 10.7

or, nvm use 10.7

No comments:

Post a Comment