Hi

I have 3 NodeJs projects deployed. Two are working fine and PM2 background process are running continuously.

But for one project it the status shows as “errored” within few minutes.

Droplet: Ubuntu 18.04.3 (LTS) x64

Please let me know how to fix this.

Regards
Mohan

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

What do the logs say?

if you run “PM2 logs” should give you an idea of what may be happening.

  • 12|rentmon | /var/ui/rentmontkeys/src/index.js:1
    12|rentmon | import React from ‘react’;
    12|rentmon | ^^^^^
    12|rentmon |
    12|rentmon | SyntaxError: Unexpected identifier

It seems you have Yarn installed using npm, in which case /usr/local/bin/yarn will link to the node script yarn.js (as defined in its package.json) and not the bash script yarn. So bash yarn start (what you are essentially doing) won’t work.

Try this instead, without interpreter:

pm2 start yarn –name test – start

Submit an Answer