simo
simo

Reputation: 24570

Nuxtjs app stops immediately when start with pm2

I am trying to run a nuxtjs app using pm2 however, the app exits immediately, and I could not get useful info from pm2 log:

2|frontend_nuxt  | Error: ENOENT: no such file or directory, chdir '����' -> '/var/www/frontend_nuxt/releases/20210831071742'
2|frontend_nuxt  |     at wrappedChdir (node:internal/bootstrap/switches/does_own_process_state:112:14)
2|frontend_nuxt  |     at process.chdir (node:internal/worker:100:5)
2|frontend_nuxt  |     at /usr/local/share/.config/yarn/global/node_modules/pm2/lib/ProcessContainer.js:298:13
2|frontend_nuxt  |     at wrapper (/usr/local/share/.config/yarn/global/node_modules/pm2/node_modules/async/internal/once.js:12:16)
2|frontend_nuxt  |     at next (/usr/local/share/.config/yarn/global/node_modules/pm2/node_modules/async/waterfall.js:96:20)
2|frontend_nuxt  |     at /usr/local/share/.config/yarn/global/node_modules/pm2/node_modules/async/internal/onlyOnce.js:12:16
2|frontend_nuxt  |     at WriteStream.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/pm2/lib/Utility.js:186:13)
2|frontend_nuxt  |     at WriteStream.emit (node:events:394:28)
2|frontend_nuxt  |     at node:internal/fs/streams:72:16
2|frontend_nuxt  |     at FSReqCallback.oncomplete (node:fs:185:23)

The nuxtjs app it self can start without issue. I have no idea how to debug this error, or how to get more useful details, any idea?

Upvotes: 1

Views: 597

Answers (1)

simo
simo

Reputation: 24570

using npm2 show id I found that the script path was not updated. so, i just had to:

pm2 delete frontend_nuxt && pm2 start ecosystem.config.js

and all is well.

Upvotes: 2

Related Questions