DEV Community

Precious Chicken
Precious Chicken

Posted on • Originally published at preciouschicken.com on

3 2

Updating Node and npm using Node Version Manager

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

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

Top comments (2)

Collapse
 
mohdahmad1 profile image
Mohd Ahmad • Edited

I would prefer volta over nvm, as provides a cleaner API. And it is available in windows too.

Collapse
 
preciouschicken profile image
Precious Chicken

Hadn't heard of it previously, but just checked out their website. You are right, looks nice. Next time I do a fresh install of my OS, I might give it a whirl - thanks.

nextjs tutorial video

📺 Youtube Tutorial Series

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay