ref. https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17babb7d5f1b ref. https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/
cd ~
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash # get latest version at https://github.com/nvm-sh/nvm#install--update-script
: reload your bash prompt
nvm --version # should print the version as a proof of successful installation
nvm ls-remote # list all versions
nvm ls # list installed versions
nvm install 8.12.0 # install a version
nvm install node # install latest
nvm use 8.12.0 # use this version for local folder
nvm use node # use latest version for local folder
nvm alias default 8.12.0 # set this version as default version aka the **global** node version
nvm current # view current version
nvm which 8.12.0 # view path of the binary nodejs
nvm which current # view path of current nodejs version
nvm alias awesome-version 8.9.4 # name/make-alias for this specific version
nvm unalias awesome-version # remove the alias
nvm run 8.12.0 --version #TODO
nvm exec 8.12.0 node --version #TODO
Very often, nodejs engineer will use yarn to install nodejs packages ref. htoc-option-2-install-yarn-using-npm
npm install -g yarn
npm install --global yarn
npm i -g yarn