Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

460
Views
How can I update NodeJS and NPM to the next versions?

I just installed Node.js and npm (for additional modules).

How can I update Node.js and the modules which I'm using to the latest versions?

Can npm do it, or do I have to remove and reinstall Node.js and npm to get the next versions?

I followed this steps in the npm section.

over 4 years ago · Santiago Trujillo
4 answers
Answer question

0

It's very late, but I give my answer so that it will help somebody who is stuck there. You can update in many ways as described above, so here I am discussing the most popular and easy way to update nodejs and npm.

 1)Update via library n 

 2)Update via nvm

Open your terminal I am using Ubuntu (Linux)

1)You can install n as any node module (globally)

npm install -g n

OR

you can also install from the source if you want

cd /tmp
git clone --depth=1 https://github.com/tj/n
cd n
sudo make install

After installation hit the below command to install the latest version of node

n latest 

now check node -v (you see the latest version is installed)

It will install the latest stable version of node.

n stable

Or you can install any version by adding version number against n like

n 0.10.33          # Install and use v0.10.33

You can check more regarding n in the following link click here

2)Now comes to second approach using NVM Install

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

After installation hit the below command to install latest version of node

nvm install node 

You can list available versions using ls-remote:

nvm ls-remote

If you want to install a specific version

nvm install 6.14.4 

To use any version after installation

nvm use node

Update npm to latest one

nvm install-latest-npm

Hope it will help!

over 4 years ago · Santiago Trujillo Report

0

Use NVM to manage node version, it will automatically take care of npm.

over 4 years ago · Santiago Trujillo Report

0

To install the latest version of npm using npm:

sudo npm install npm@latest

I run this on Linux so I am not sure about other operating systems.

On Linux you can also run:

sudo apt-get update
sudo apt-get upgrade

This will tell the apt-get package manager to update and upgrade all packages.

over 4 years ago · Santiago Trujillo Report

0

sudo n list => show the list of installed versions sudo n stable => install latest stable version.

You can also use nvm to install latest version or change between different versions.

For latest npm version: npm install -g npm@latest

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!