Installing CentOS7 NodeJS source compilation / v12.16.1 LTS
0. Installation environment (g ++ 6.3.x)
CentOS 7 has gcc version 4.8 installed by default. However, nodejs build environment requires version 6.3 or higher.
Please refer to the following link to install version 6.3.
1. Download NodeJS source
Connect to the NodeJS homepage and download the source of the LTS version using the wget command.
[root@localhost ~]# wget https://nodejs.org/dist/v12.16.1/node-v12.16.1.tar.gz
2. Decompression
Unzip the source compressed file received as tar.gz.
[root@localhost ~]# tar xfz node-v12.16.1.tar.gz
You can see that the node-v12.16.1 folder is created. The contents of the file in the extracted folder are as follows.
3. configure
Run configure in the unzipped folder of nodejs.
[root@localhost node-v12.16.1]# ./configure
4. make
After running configure, run the make command to compile.
# make
Depending on the performance of your computer, it may take a very long time, so wait until it is over.
5. make install
When the build is complete, install it in the installation path using the make install command.
# make install
6. Command confirmation
When install is complete, you can run npm and node commands as follows to view version information.
Comments
Post a Comment