linux系统(centos7)安装node
使用 wget 复制的地址链接(下载完之后是gz格式)解压 tar -zxvf 压缩包名makemake install查看有没有安装成功(两个都有证明安装成功)[root@localhost ~]# cd /var/www/html/[root@localhost html]# vim dome.jsvar http =
·
使用 wget 复制的地址链接(下载完之后是gz格式)
解压 tar -zxvf 压缩包名
cd node-v0.10.29
./configure
make
make install
查看有没有安装成功(两个都有证明安装成功)
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# vim dome.js
var http = require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'});
res.end('Hello World\n');
}).listen(1337,'192.168.100.50');
console.log('Server running at http://192.168.100.50:1337/');
[root@localhost html]# firewall-cmd --zone=public --add-port=1337/tcp --permanent 防火墙可以访问1337端口
success
[root@localhost html]# systemctl restart firewalld.service 重启防火墙
[root@localhost html]# node dome.js
Server running at http://192.168.100.50:1337/
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)