When I write the command npm run prod
the code run normally
When I write the command pm2 start npm -- run prod
it does not work.
Error on pm2 log:
:: Created by npm, please don't edit manually.
^
SyntaxError: Unexpected token ':'
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Object.<anonymous> (C:\Users\Jonathan\AppData\Roaming\nvm\v14.17.0\node_modules\pm2\lib\ProcessContainerFork.js:33:23)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
PM2 | App [integrator:0] exited with code [1] via signal [SIGINT]