Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。官网地址https://nodejs.org/en/ 其优点在于使用了一个事件驱动、非阻塞式 I/O 的模型,异步编程,使其轻量又高效。 当然缺点也很明显单进程,单线程,只支持单核cpu,不能充分的利用多核cpu服务器。
本教程安装环境为 1、Centos8 x86 最小化安装系统-虚拟机,8核16G内存500G存储
下面我们开始进行正式安装:
1、安装node.js环境 访问官网获取到linux x64的源码包 https://nodejs.org/en/download/
cd /opt/
wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz
xz -d node-v12.16.1-linux-x64.tar.xz
tar -xf node-v12.16.1-linux-x64.tar
echo "export NODE_HOME=/opt/node-v12.16.1-linux-x64" >> /etc/profile
echo "export PATH=\$NODE_HOME/bin:$PATH" >> /etc/profile
source /etc/profile
rm -rf node-v12.16.1-linux-x64.tar
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
yum install nodejs -y
检查版本
node -v
npm -v
至此完成nodejs的安装,开始使用吧。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有