linux - Ubuntu nodejs pm2 and forever get ENOENT errors for accessing /tmp dir -
I have an Ubuntu 14.04 server on the digital ocean
This is running nodes (restart) Uploads the file, and after uploading it goes to / tmp in my storage directory.
running sudo node app.js has access to / tmp.dir when I use 2 pm2 or forever, I get an error ENOENT.
I paste 777 / TMP DIM and did a loin for the root (as I am running 2 pm and forever).
But every time I upload a new file, the permissions 777 are not on the newly uploaded file.
How do I create 777 permissions for all new files in / tmp, or use Pm2 or forever script?
Going out, this was giving the error with an ENOENT on the TMP directory, Although this was a different issue
The directory in which I was moving it was not present. I was using the related URL in the script, and so running like usual / pm2, it was not matching
Fix the files using the path module and using the full url.
Hope this helps someone
Comments
Post a Comment