pm2 and forever command for beginnners

pm2 and forever command for beginnners

pm2 and forever is a tool to run the process at the background, many of the angular developers are using these tools nowadays in any linux/amazon ec2 machines for angular universal server side rendering(ssr) for seo and many other features.

 

Herewith I have listed the few mostly used commands:

pm2 commands:

pm2 start your_js_file (pm2 start local.js) in my case for angular universal run,

this build is created using the below commands,

npm run build:prod (or) yarn run build:prod 

and

npm run server (or) yarn run server

 

pm2 list: list down all the pm2 processes.

pm2 kill: to kill all the running pm2 processes

pm2 monit: to monitor the running processes

pm2 logs: to see the logs of the running pm2 processes.

 

 

 

Forever commands:

forever local.js (runs directly)

forever show

forever start local.js (runs in daemon mode)

114 total views, 2 views today

Leave a Reply

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