This article demonstrates how to install Nodejs on CentOS7.
https://nodejs.org/dist/
Find the version that needs to be installed. Take version 8.11.3 as an example. The address is:
https://nodejs.org/dist/v8.11.3/node-v8.11.3.tar.gz
$ mkdir -p /usr/local/nodejs
$ wget https://nodejs.org/dist/v8.11.3/node-v8.11.3.tar.gz
$ tar -zxvf node-v8.11.3.tar.gz -C /usr/local/nodejs
$ yum -y install gcc gcc-c++ kernel-devel
$ cd /usr/local/nodejs/node-v8.11.3
$ ./configure
$ make
$ make install
Execute the above instructions in sequence. The make process may take a little longer. After the instructions are executed, Node is installed. You can use node -v
and npm -v
to check whether the installation is successful.
nodejs can use the n module to update:
$ npm install -g n
$ n stable
$ n 8.11.3
Recommended Posts