Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

zsh: permission denied when running from outside directory

I have a package.json at:

/home/user/dev/project/package.json

If I navigate to this location:

cd /home/user/dev/project

Then run a command:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

npm run compile

It works and there are no errors.

However, if I try to run the command like this

/home/user/dev/project/ npm run compile

I get a message:

zsh: permission denied: /home/user/dev/project/

Why is this happening? I have not changed the user I’m logged in as.

>Solution :

The first word of a command is the name of the program to run. The directory is not an executable program, so you get that error.

If you want to refer to a file in another directory, put the directory name in the filename:

npm run compile /home/user/dev/project
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading