1

my react project need updated nodejs. so how i can reinstall my node js to latest version in Ubuntu 16.04.

my current node version is

node -v
v6.0.0

my current npm version is

npm -v
3.8.6

ideally i want to reinstall my nodejs, node & npm to its newest version.

Vaibhav S
  • 710
  • 1
  • 9
  • 19

4 Answers4

6

Uninstall NodeJS from Ubuntu

The command will remove the package but retain the configuration files.

sudo apt-get remove nodejs
sudo apt-get autoremove

To remove both the package and the configuration files run:

sudo apt-get purge nodejs
sudo apt-get autoremove

Install NodeJS on Ubuntu

Adding the NodeJS PPA to Ubuntu

sudo apt-get install software-properties-common
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

After successfully adding the NodeJS PPA, It’s time now to install NodeJS using the command below.

sudo apt-get install nodejs

Verfiying the version of NodeJS and NPM

node -v
npm -v

More Info: http://www.rscoder.com/2020/04/how-do-i-completely-uninstall-nodejs.html

Rahul Shukla
  • 6,107
  • 3
  • 13
  • 24
  • After uninstall, Restart system and then check node version, If showing there is some issue otherwise follow installation steps :) – Rahul Shukla Jun 26 '19 at 09:55
1

Uninstall NodeJS from Ubuntu

  • sudo apt-get remove nodejs
  • sudo apt-get update

Follow below link to install latest nodeJs in ubuntu

https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/

Ones you installed successfully, then if you want to check node version use below command.

node -v

Serg
  • 2,293
  • 3
  • 29
  • 38
Prakash Harvani
  • 987
  • 6
  • 17
0

Have you tried this?

sudo npm cache clean -f
sudo npm install -g n
sudo n 10.16.0

Or n latest to install latest version of node.

ThanhPhan
  • 1,225
  • 2
  • 12
  • 24
0

Follow below link to install and use other version of nodeJs in ubuntu

https://stackoverflow.com/a/59392965/9490901