centos node npm

xiaoxiao2021-02-28  63

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.6miu.com/read-63444.html

最新回复(0)