CentOS installation deployment Nodejs

We use the official website direct download compiled binary file to install.

  1. Right-click on the red circle to the official website of content, copy the download address;

  2. To the cd /usr/localdirectory, use wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xzthe download package;

  3. Use the tar -xJf node-v10.16.3-linux-x64.tar.xzcommand to extract;

  4. Configure the environment variables: vi /etc/profileFinally, add

export NODE_HOME=/usr/local/node-v10.16.3-linux-x64
export PATH=$NODE_HOME/bin:$PATH

Save and exit, the implementation of source / etc / profile so that the environment variables to take effect;

  1. In turn enter node -vand npm -vverify that the installation was successful.

Guess you like

Origin www.cnblogs.com/kjgym/p/11614557.html