3

I tried these two commands to uninstall node js but I am not able to do it.

sudo apt-get purge nodejs
sudo apt-get autoremove

when I check for version, it shows

v9.3.0

And I want to install node 8.x

Asif Ahmed
  • 137
  • 2
  • 5
  • 19

2 Answers2

2

I got the same problem.

Step 1: Find the node location using

rails@rails-All-Series:~$ whereis node
node: /usr/local/bin/node

Step2: Remove node module from these the location.

rails@rails-All-Series:/usr/local/bin$sudo rm -rf node
Mr Singh
  • 3,526
  • 3
  • 36
  • 53
-1

Below mentioned link specifies how to delete node package from ubuntu

sudo apt-get purge nodejs

it will only be purging related nodejs packages

Other Alternative will be:

 sudo apt-get purge --auto-remove nodejs

it will be implementing the below mentioned commands internally:

 sudo apt-get purge nodejs
 sudo apt-get autoremove

autoremove will actually be removing the related package and they were installed as a dependency module .

Osama Rizwan
  • 599
  • 1
  • 6
  • 19
Rohan
  • 2,551
  • 1
  • 10
  • 17