** Preface: ** when they build the server to find a bunch of articles to be successful, since so much trouble I put their own basic operation record, save you to build and spend a bunch of time. (All nonsense)
Install the Node
- Download Node (Create a new directory to store Node files for easy management.) The version number can be set according to the version number on the NodeJs official website
Wget HTTP: / / https://npm.taobao.org/mirrors/node/v8.11.0/node-v8.11.0-linux-x64.tar.xzCopy the code
- Unpack the
The tar XVF - node - v8.11.0 - Linux - x64. Tar. XzCopy the code
- The test goes to the decompressed folder
cdTar -xvf node-v8.0.0-linux-x64.tar.xz/bin./node -vCopy the code
Normal display V.8.11.0
- Configure global environment variables
ln -s< path >/bin/node /usr/local/bin/node
ln -s< path >/bin/npm /usr/local/ bin/NPM example: ln-s/ node/node_install_path/node - v8.11.0 - Linux - x64 / bin/node/usr /local/bin/node
Copy the code
< path > Fill in the installation directory. For example, my directory is /node/node_install_path/node-v8.11.0-linux-x64, notice ln -s /node… If you don’t know the path, run PWD to check the current path.
Related articles
- [Node] CentOs Set up NodeJs server – Install Mongodb
- [Node] CentOs Set up NodeJs server – Install PM2