K
K
kaleon2019-01-25 19:48:46
linux
kaleon, 2019-01-25 19:48:46

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

Issues
env: ‘/home/newus/.npm-global/lib/node_modules/pm2/bin’: Permission denied

Already tried
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

2 answer(s)
S
Softer, 2019-01-25
@Softer

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 :)

A
anothere64, 2019-01-25
@anothere64

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 question

Ask a Question

731 491 924 answers to any question