centos node npm

前端之家收集整理的这篇文章主要介绍了centos node npm前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

yum install -y gcc-c++ make

curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash -

yum install nodejs

node -v
npm -v

vim demo_server.js
var http = require(‘http’);
http.createServer(function (req,res) {
res.writeHead(200,{‘Content-Type’: ‘text/plain’});
res.end(‘Welcome Node.js’);
}).listen(3001,“127.0.0.1”);
console.log(‘Server running at http://127.0.0.1:3001/‘);

node –debug demo_server.js

原文链接:https://www.f2er.com/centos/376069.html

猜你在找的CentOS相关文章