1. Uninstall Node NPM
(1) Uninstall NPM First:
sudo npm uninstall npm-g
(2) then uninstall node. js.
(2.1) If it is an Ubuntu system and is installed using Apt-get, you can use the command:
sudo apt-get Remove Nodejs
(2.2) Source file installation node, uninstall mode: first CD to Unzip to the directory:
sudo make Uninstall
(2.3) A brew-installed node (Brew install node) under the Mac platform, with the Uninstall method:
1. Uninstall using the Brew uninstall Node command
2. Execute commands under Terminal, uninstall node other related directory
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
3. Execute the brew Doctor command to see what else is in the directory associated with node, NPM, and delete. Previously, because of the lack of this step, has not been completely uninstalled.
2. Install node NPM
node. JS official download page: https://nodejs.org/en/download/current/
I chose the latest version, yes: https://nodejs.org/dist/v6.3.1/node-v6.3.1.tar.gz
General third-party software on Linux installation directory is/usr/local, use wget download source code (address their own attention to replace):
sudo wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz
Unzip:
Tar xzvf node-v* && CD node-v*
Compile:
./configuremake
This process may be slow, wait for completion, and then install:
sudo make install
If all goes well, node. JS is installed, use Node-v to view the version.
(2) Installing NPM:
NPM Install
Linux Uninstall Install node NPM