Linux serverNETWORK ADMINISTRATIONS

How To Install Latest Nodejs and NPM on CentOS 7

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications|
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash –
yum install -y nodejs
node -v
npm -v

nano 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

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *