# This will install only dependencies , and not devDependencies ,
# regardless of the value of the NODE_ENV environment variable.
npm install --omit=dev
npm install --only=prod
# Set NODE_ENV=production
# OR
npm install --production
npm install --only=prod
Basic usage of PM2:
npm install -g pm2
...to install PM2.
pm2 start my_script.js
Starts a script and lets it run in background.
pm2 status
Shows the status of any running scripts.
pm2 restart all
Restarts all running scripts.
pm2 kill
Stops all scripts and completely shuts down the PM2 daemon.
pm2 monit
Monitors CPU/RAM usage and shows it.
pm2 logs