When I run through DEBUG = myapp: * npm start - everything works. Pm2 works with only one page and does not see the require modules in the script.

//пробовал и так pm2 start /var/www/html/myapp //и так pm2 start /var/www/html/myapp/app.js //и так pm2 start /var/www/html/procesess.json 

Nothing works.

    1 answer 1

    Article + node + pm2 + express + ngnix helped

    This is somehow related to the lost compatibility of express to Pm2.

     pm2 start app.js //больше не работает 

    You need to look for the entry point to the application in package.json:

     "scripts": { "start": "node ./bin/www" }, 

    And run pm2 in the application directory and in the non-root user:

     pm2 start ./bin/www 

    After that, be sure to leave the non-Nirut user. And run under the root:

     pm2 startup ubuntu 

    That's the kind of magic.