pm2 automatically deletes an npm module
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?
npm install coinbase/gdax-node- call an API from gdax module and keep it running.
- 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.
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 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?
Can you try on another server/laptop ? Can you run pm2 report and give the result here ?
closing the issue as it may not be due to pm2 but npm.