Install Node.js on Ubuntu/Debian

To install Node.js on Ubuntu, first setup repository as per your version requirments.

For NodeJs v11.x

Node.js v10.x

Node.js v9.x

Node.js v8.x

Node.js v6.x

Now install node.js with

Some npm modules may need to compile and install native extenion, if you need it

See Node.Js

nodemon

Node.js applications when you run with nodejs command, you need to restart when a change is made to source code of the application.

nodemon will watch your application source code for changes, restart if a change is detected.

To install nodemon, run

Example

nodejs

pm2 process manager for node.js

Auto Start pm2 on boot

pm2 is a process manager for node.js applications. It is similar to forever.

http://pm2.keymetrics.io

First you need to install npm, on Ubuntu/Debian, run

To install pm2, run

Start an Application

Start an Application with name

Start Application in Cluster mode with

To Scale a clustered application, run

Start the processes on reboot

List running applications

Controlling running application

Restart all running applications

nodejs

Install Node.js on CentOS Server

To install Node.js on CentOS 7

Add node.js repository

NodeJS 11.x

NodeJS 10.x

NodeJS 8.x

NodeJS 6.x

Install node.js with

For npm to install native modules, install dev tools

Or

See Node.Js