How to Manage Node Versions with n
November 22, 2019
n is an npm package by TJ Holowaychuk for Node version management. It's amazing.
To Install
npm install -g n
To Use
# Installs and uses node @ version XX.XX.XX
n XX.XX.XX
# Adding the optional "v" before the version number installs and uses node @ version NN.LL.LL (Where LL equals the latest minor version + patch version for version NN)
n vNN
# Installs and uses node LTS (Long Term Support) version
n lts
# Check node version
node -v
Yep, it's that easy.
Note: You may need to use 'sudo n xx.xx.xx' if prompted by the terminal.