Node.js
Install - FRESH nodejs using fnm, or nvm
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
# download and install Node.js
fnm use --install-if-missing 20
# verifies the right Node.js version is in the environment
node -v # should print `v20.15.1`
# verifies the right NPM version is in the environment
npm -v # should print `10.7.0`# check [REF-3] Github for the latest version
$ curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# the script install "export NVM_DIR=..." to .bashrc because
# .bash_profile does not exist
$ source ~/.bashrc
# when using the interactive terminal
#source ~/.bash_profile
# verify installation
$ command -v nvm
# install latest LTS node.js
$ nvm install --lts
# checked installed version - Jun 23, 2022
$ node --version
v16.15.1
$ npm --version
8.11.0
[Alternative] Install - nodejs using apt
Update nodejs version in WSL
References
Last updated