In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to install nodejs in CentOS7, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
1. Confirm dependence on the environment
Make sure that the server has nodejs compilation and dependent software, if not, you can install it by running the following command.
Yum-y install gcc gcc-c++ openssl-devel
2. Download the NodeJS source package and decompress it
Go to the directory where you want to store the download resources, and this article is stored in the / usr/local/src/ directory. Then execute the command to download the source package:
Wget https://npm.taobao.org/mirrors/node/v10.16.1/node-v10.16.1-linux-x64.tar.gz
Decompression
Tar-zxvf node-v10.16.1-linux-x64.tar.gz
Rename the folder after the decompression is complete, rename the folder to node (optional):
Mv node-v10.16.1-linux-x64 / usr/local/node
3. Test whether the installation is successful
Go to the bin directory under the node directory and execute the ls command:
[root@ncd-sc-nginx tool] # cd / usr/local/node/bin/ [root@ncd-sc-nginx bin] # lsnode npm npx [root@ncd-sc-nginx bin] #. / node-vv10.16.1
Configure environment variables
Vim / etc/profile#set for nodejsexport NODE_HOME=/usr/local/nodeexport PATH=$NODE_HOME/bin:$PATH
Compile profile to make the configuration effective
Source / etc/profile
View the version:
Node-version
If the version number is output, the installation is successful.
5 upgrade the node version with the n command
Install the command npm install-g n
Upgrade n latest after installation
Npm install-g nn latest
Now you can use the latest version of node.
Other (optional)
1. Add Taobao image for npm
Npm config set registry https://registry.npm.taobao.org
When you are finished, you can use:
Npm config get registry
View the results of the modification.
2. Use the cnpm of Taobao npm image (the method used in this article)
Because downloads are foreign servers that are slow to drop, we need to use Taobao's npm image cnpm. Execute the command:
Npm install-g cnpm-- registry= https://registry.npm.taobao.org on how to install nodejs in CentOS7 to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.