Download the node

  1. First you need to download a Linux version of Node from the Node website.

Upload node to Linux server and unzip it

  1. Uploading a Compressed package

You can use some visual server connection software. I used MobaXterm. You can download and install it directly from the official website, and there is a free version. Then drag the downloaded Node zip package (my version: Node-v14.15.5-linux-x64.tar.xz) to the server. It can be any directory, but /usr/local/src or /home is generally recommended.

Of course, you can also use the following command to pass the file directly to the server

SCP node-v14.15.5-linux-x64.tar.xz root@ your server :/usr/local/srcCopy the code
  1. Decompression package
The tar XVF - node - v14.15.5 - Linux - x64. Tar. XzCopy the code
  1. Rename the decompressed Node file to facilitate subsequent operations
Node - mv v14.15.5 - Linux - x64 nodejsCopy the code

Global references

  1. Creating a Soft connection

npm

ln -s /usr/local/src/nodejs/bin/npm /usr/local/bin
Copy the code

node

ln -s /usr/local/src/nodejs/bin/node /usr/local/bin
Copy the code
  1. Check whether the global configuration takes effect
npm -v
Copy the code

node -v
Copy the code

If the version number is displayed correctly, the installation is successful