node.js
node -v
-> version
Node Version Manager nvm
Bash script to manage multiple versions of node.js
nvm list
- list packagesnvm list-remote --lts
- list remote available packagesnvm install <version>
- install a specific versionnvm install lts/*
- install the latest lts version
nvm use <version>
- use a specific versionnvm use system
- use the system installed version (i.e. a version not managed by nvm)nvm install node --reinstall-packages-from=node
- install/upgrade the newest versionnvm install-latest-npm
- install latest npmnvm alias default <version>
- set the default version
Node versions
nvm install lts/erbium
- install node v12nvm install lts/fermium
- install node v14
.nvmrc
Content of .nvmrc
:
lts/erbium
-> node v12lts/fermium
-> node v14