I am using the NX workspace. In my project have a Nest Js app. I used to deploy this app in AWS EC2. I installed PM2 there.
// pm2.config.js
module.exports = {
apps: [
{
name: 'Backend API',
script: 'npm',
args: 'start',
cwd: 'apps/api/src',
interpreter: 'ts-node',
env: {
PORT: 3000,
NODE_ENV: 'production',
},
},
],
};
This strip is in my root directory and I run pm2 start pm2.config.js
Not working. Have any solution for this
I just change this script to this. It's work