Added more instructions for nvm and code example (#18357)

This commit is contained in:
Paul Isaris
2018-10-13 21:36:06 +03:00
committed by Heather Kusmierz
parent 547cf6cc1a
commit 7dcfac9dc6

View File

@ -85,6 +85,8 @@ npm list # for local packages
## Node Version Manager `nvm`
nvm is a popular version manager for npm. It lets you install multiple npm instances on the same machine, giving you the opportunity to also have different versions for global packages, for each npm installation. You can find [more information on nvm here](https://github.com/creationix/nvm).
Say you want to install Node v6.9.1 you would write on the terminal:
```shell
@ -97,6 +99,12 @@ If you have multiple versions of Node.js installed on your workspace, you can sw
nvm use 4.8.4
```
If you want to install another version of Node.js and also re-install all global packages from another installed version:
```shell
nvm install 8.11.1 --reinstall-packages-from=4.8.4
```
### Making a node version default.
In order to set a default version of node for your workspace, just type: