Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. In this article we will explain the steps of installing node.js and npm in CentOS.
Step 1: Add node.js yum repository
sudo yum install -y gcc-c++ make
sudo curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
Step 2: Install node.js and NPM
sudo yum install nodejs
Step 3 : Verify
sudo node -v
v6.9.4
sudo npm -v
3.10.10