Hi,
To use npm commands with PM2, it seems that you need to create a config file:
ecosystem.config.js
module.exports = {
apps : [
{
name: "nuxt-dev",
script: "npm",
args: "run dev"
},
{
name: "nuxt-prod",
script: "npm",
args: "run start"
}
]
}
then for development mode:
pm2 start ecosystem.config.js --only nuxt-dev
or for production mode:
npm run build && pm2 start ecosystem.config.js --only nuxt-prod
# for development
pm2 start npm --name "nuxt" -- run dev
# for production
npm run build
pm2 start npm --name "nuxt" -- start
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment