The current stable “LTS” version of node is 10.15.3 (2019-04-03) see: nodejs.org for latest.
Step 1 – Get NVM (Node Version Manger)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Step 2 – Install the version of node.js you need
Once you’ve got NVM you can install a specific version of Node.js using the nvm command:
nvm install v10.15
Note: you may need to close & re-open your terminal window for
nvm command to be available.
You should expect to see something like this in your terminal:
Now using node v10.15.3
Step 3 – Enjoy the rest of your day!
Yes, it’s that easy and didn’t require
Now please Upvote this (so others can avoid
and have a lovely day writing node.js code!
Microsoft Windows User? Use: https://github.com/coreybutler/nvm-windows
Review of the node mailing list indicates that using NVM (Node Version Manager) is the preferredway to manage your nodejs versioning/upgrading. see: github.com/creationix/nvm
NVM by Tim Caswell (& friends) is “better” than N from visionmedia (TJ Holowaychuk) github.com/visionmedia/n because the verbose commands mean is much easier to keep track of what you are doing in your Terminal/SSH Log. Its also faster, saves kittens by not requiring
sudo and is used by the team at liftsecurity.io the node.js security experts!
Also worth noting: NVM has almost three times as many GitHub Stars as N (22896 vs 8040). That’s usually – but not always – a sign of a better module… feel free to correct if you have evidence of otherwise …
P.S. this may be a dupe of How can I uninstall or upgrade my old node.js version?