1. Current environment
- The Tencent cloud server configuration environment is as follows
- Log in to the cloud server using a standard login method. If you forget the password, choose Instance > More > Password Key > Reset Password to change the password
- View the bit information about the server
Command:uname -a
2. Install the node
2.1 Test the sword
- Enter the following directory
cd /
- View all current files
ll
View all files in this directory
2.2 download the node
- Go to the /usr/local directory
cd /usr/local
- FTP upload: Download the latest NodeJS file from the official website
- Wget download:
Wget HTTP: / / https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz
2.3 Decompressing and renaming files
- File node-v12.18.3-linux-x64.tar.xz:
ll
- Extract:
The tar XVF - node - v12.18.3 - Linux - x64. Tar. Xz
- The file name is too long. Change the name of the decompressed folder:
Node - mv v12.18.3 - Linux - x64. Tar nodejs
- It turns out we already have a NodeJS folder
3. Set up global links
- In order for every place to access Node, we establish a global connection
- Exit to root:
cd /
- And then do it in sequence
ln -s /usr/local/nodejs/bin/npm /usr/local/bin/
ln -s /usr/local/nodejs/bin/node /usr/local/bin/
- After performing
node -v
See already successful!
4. Other
- Of course, some people will be stuck in the last step of the global binding, will find that the binding cannot be, in this case, need to check whether the path is correct.
- Go to usr to see if there is a local directory. If there is no local directory, delete the local directory and bind it directly to bin
Ln -s/usr/local/nodejs/bin/NPM/usr/bin/ln -s/usr/local/nodejs/bin/node/usr/bin/if it is not successful, whether it is right to check the road ahead.