Install and configure Node.js in Linux environment

1. Check the version on the official website, LTS represents the long-term supported version

2. Enter the server

3. Enter the command: wget https://npm.taobao.org/mirrors/node/v8.9.3/node-v8.9.3-linux-x64.tar.xz

                        · Xz -d node-v8.9.3-linux-x64.tar.xz someone tar -xzvf node-v8.9.3-linux-x64.tar.gz

                      ·tar -xvf node-v8.9.3-linux-x64.tar

                     ·ln -s /root/node-v8.9.3-linux-x64/bin/node /usr/local/bin/node

                     ·ln -s /root/node-v8.9.3-linux-x64/bin/npm /usr/local/bin/npm

(Hint: The last two steps need to be executed in the root directory)

 

 

4. Enter the command: node -v The version number appears and the installation is successful

                       npm -v shows the version number and the installation is successful

 

 

5. The installation package through the cnpm command will be downloaded through the Taobao mirror NPM, and the speed will be faster.

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

The installation is complete here, I hope it helps

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324955605&siteId=291194637