First go to the official website to download the installation package, two types of installation, one is source code code source installation, one is compiled binary file installation.
(i) binary file installation
Simply said that after decompression, in the Bin folder already exist node and NPM, if you go into the corresponding file in the execution of the command line a bit of a problem is not, but not the overall, so set this as the global good.
Set Global:
ln -s /home/kriry/node/bin/node /usr/local/bin/node
ln -s /home/kriry/node/bin
/npm /usr/local/bin/npm
查看当前安装的Node的版本
node -v
(ii) compiling by source code
This way the file you downloaded is source code. Go to the Unzip directory,
./configure
make
make install
(c) Apt-get
There is also a apt-get way of shell hints, sometimes the installation source version is too low. Not recommended
|
sudo apt-get install nodejs sudo apt-get install npm |
node. JS Builds local node environment