Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

452
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda