Skip to content

Instantly share code, notes, and snippets.

@ratacibernetica
Created June 5, 2018 15:19
Show Gist options
  • Save ratacibernetica/3be7f26de2e844f72e66e20f8bbaa171 to your computer and use it in GitHub Desktop.
Save ratacibernetica/3be7f26de2e844f72e66e20f8bbaa171 to your computer and use it in GitHub Desktop.
Install Node on Centos
# Add Node.js Yum Repository
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash -
# Install Node.js and NPM
yum install nodejs
# Check Node.js and NPM Version
npm -v
# Create Demo Web Server (Optional)
vim demo_server.js
# // replace 127.0.0.1 with your domain
# 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 --inspect demo_server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment