This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi there,
It sounds like that your nodejs
user does not have access to the /root
directory.
I’ve just tested running the project with the root
user directly and it works well:
pm2 start app.js
[PM2] Applying action restartProcessId on app [app](ids: 0)
[PM2] [app](0) ✓
[PM2] Process successfully started
What you could do is:
pm2
as the root usernodejs
user, and git clone
the project into the nodejs
user’s home directory, that way the nmodejs
user will be the owner of the files and would not have that permissions problemLet me know how it goes!
Best,
Bobby
Hi @henriavo,
This sounds like a permissions/ownership issue. See if your have set some weird permissions most of all. Usually, and I believe the express app has the same permissions, they need to be 755 for folders nad 644 for files. You can do that for a faster outcome:
- find /path/to/express/app -f -exec chmod 644 {} \;
- find /path/to/express/app -d -exec chmod 755 {} \;
Where /path/to/express/app should be the real path.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.