linux installation nodejs There are two ways for a simple, decompression can be used; another, download source code, compile mounted by, make, make install command.

  Here we talk about first, simple and convenient. No need to perform mak, make install. Proceed as follows:

First, determine the linux system you are using, and then download the compressed package response. Here I downloaded the node-v6.11.2-linux-x64.tar.xz

Second, linux uploaded to the relevant path, typically / usr / local /, and use the command

   xz -d node-xxxx.tar.xz --- will tar.xz to extract the tar file

   tar -xvf node-xxxx.tar --- extract the tar file into a folder

  Name mv node-xxx node ---- change the folder, change node

Third, check whether the installation was successful

 

Fourth, the configuration software is connected, you can use the global command node

ln -s / usr / local / node / bin / node / usr / bin / node - node maps the source file to the file in the node usr / bin

ln -s / usr / local / node / bin / Elevation / usr / bin / Elevation

Fifth, the node configuration file installation path

Into the / usr / local under / node / Path:

mkdir node_global

mkdir node_cache

npm config set prefix "node_global"

npm config set cache "node_cache"

 

Sixth, when you feel npm slow, you can install cnpm

asl install cnpm --registry g = https: //registry.npm.taobao.org

This way you can check the -g global installed there, the installation file to node_global in accordance with previously set.

如下全局使用cnpm,也要记得配置一个软连接。