How set path to root directory for pm2?

Viewed 126

I have script server.mjs

-Root
-/node_modules/pm2/lib
-server.mjs
-package.json

I create ecosystem.config.js

module.exports = {
  apps : [{
    name: "proxy",
    namespace: "localhost",
    script: 'server.mjs',
    watch: 'server.mjs',
    env_production: {
      NODE_ENV: "production"
    },
    env_development: {
      NODE_ENV: "development"
    }
  }],
};

In package.kson i have script

"server:start": "pm2 start ecosystem.config.js --only proxy",

Then i go ti page i see this

Error: ENOENT: no such file or directory, stat '/home/sergey/Desktop/newkind/node_modules/pm2/lib/index.html'

pm2 see root project dir is /home/sergey/Desktop/newkind/node_modules/pm2/lib/

Can i set path to root dir /home/sergey/Desktop/newkind/ ?

0 Answers
Related