pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 automatically deletes an npm module

Open adityamertia opened this issue 8 years ago • 4 comments

What's going wrong?

PM2 automatically deletes an npm module folder (./node_modules/gdax/). Happens only when the app is run through pm2 start gdaxapp.js and doesn't happen if run using nohup node gdaxapp.js >/dev/null 2>&1 &

How could we reproduce this issue?

  1. npm install coinbase/gdax-node
  2. call an API from gdax module and keep it running.
  3. After an random time ( could be 3-4 hours or 9-10 hours) the ./node_modules/gdax folder gets deleted automatically and the app start throwing errors of gdax module not found.

adityamertia avatar Jan 10 '18 14:01 adityamertia

PM2 never touch user files, it must come from another system, are you sure that the folder is here but with the wrong permission ?

vmarchaud avatar Jan 10 '18 15:01 vmarchaud

@vmarchaud I also thought pm2 should not touch user files, however the only delta in the working and non working setup is pm2. I run the app using nohup (run it in background) and it works. If i run it via pm2, after a random duration some of node_modules folders get deleted. I haven't changed permissions. What has permissions to do with this? Can you specify how better can i help reproduce this issue. I have posted the steps above, any more information required?

adityamertia avatar Jan 11 '18 09:01 adityamertia

Can you try on another server/laptop ? Can you run pm2 report and give the result here ?

vmarchaud avatar Jan 11 '18 11:01 vmarchaud

closing the issue as it may not be due to pm2 but npm.

adityamertia avatar Jan 12 '18 10:01 adityamertia