Updating Node and npm using Node Version Manager

Precious Chicken - Mar 28 '21 - - Dev Community

Node Version Manager is a "POSIX-compliant bash script to manage multiple active node.js versions." It is a very useful tool for taming Node.js which can throw up some strange problems when you install it in the standard fashion.

However I only ever use two commands, which I can never remember off the top of my head, so here they are:

Update Node.js to latest Long Term Support version

nvm install --lts
Enter fullscreen mode Exit fullscreen mode

Update npm

nvm install-latest-npm
Enter fullscreen mode Exit fullscreen mode

I only realised this was an option recently thanks to a post by MuffinMan.

Where am I again?

And to confirm which versions you are using:

node --version && npm --version
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player