Install Nodejs on Linux system

1. Go to the official website to download the file that matches your system:

 English URL: https://nodejs.org/en/download/

 Chinese website: http://nodejs.cn/download/

 Through the uname -a command, I can see that the number of bits of my Linux system is 64 bits (Note: x86_64 means 64-bit system, i686 i386 means 32-bit system)

 

2. The downloaded tar file is uploaded to the server and decompressed, and then becomes global by establishing a soft connection;

1) The upload server can be any path of its own, currently my placement path is cd /app/software/

2) Unzip and upload (I changed the name of the unzipped file to nodejs here, this place is at your own discretion, as long as you write it correctly when establishing a soft connection)

    ① tar -xvf   node-v6.10.0-linux-x64.tar.xz   

    ② mv node-v6.10.0-linux-x64 nodejs 

    ③ Confirm whether there are node and npm files in the bin directory under nodejs, if there is a soft link, if there is no re-download, perform the above steps;

3) Establish a soft connection and become global

 

   ①ln -s /app/software/nodejs/bin/npm /usr/local/bin/ 

 

   ②ln -s /app/software/nodejs/bin/node /usr/local/bin/

 

4) The last step is to check whether nodejs has become global

The node -v command on the Linux command line will display the nodejs version, as shown in the figure, you are done

 

Guess you like

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