Reputation: 304
I just removed nodejs completely by using following command
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
. now i again trying to install the nodejs after successful installation by typing node -v
or npm -v
it showing no such a file or directory bash: /usr/local/bin/npm: No such file or directory
. please help me to install nodejs LTS version again.
Thanks in advance
Upvotes: 0
Views: 55
Reputation: 4293
First of all remove all the instances of nodejs. For a fresh new install. Since your's is not working use
sudo apt-get purge nodejs
Then install nvm
which is the best tool to install nodejs and npm.
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
Update your bash
source ~/.profile
The below code will install the node version 6.11.5 Or check the github page of node version manager(nvm)
nvm install v6.11.5
Now hopefully your system will work with node without any issue
Upvotes: 1