Answer the question
In order to leave comments, you need to log in
Permission problem, how to solve?
I administer the server, when you enter
sudo env PATH=$PATH:/usr/bin /home/newus /.npm-global/lib/node_modules/pm2/bin /pm2 startup systemd -u newus --hp /home/newus
env: ‘/home/newus/.npm-global/lib/node_modules/pm2/bin’: Permission denied
sudo chmod -R 755 /home/newus/.npm-global/lib/node_modules/pm2/bin
sudo chmod 750 /home/newus/
sudo chmod +rw /home/newus/.npm-global/lib/node_modules/pm2/bin
Answer the question
In order to leave comments, you need to log in
Produces correctly.
In PATH, paths are written with ":" instead of spaces. And I suspect that "/home/newus/.npm-global/lib/node_modules/pm2/bin" is not a binary. I would also refuse to run the directory :)
Maybe something like this?
sudo env "PATH=$PATH:/usr/bin:/home/newus/.npm-global/lib/node_modules/pm2/bin" startup systemd -u newus --hp /home/newus
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question