13

I'm having issues with my new linux setup - I've installed nodemon as a local dependency (NOT globally) and I'm trying to execute it from my package.json "start"-script. I'm getting this permission error.

node by itself works great, but as soon as I try to use babel-node or nodemon or even mocha, I get permission problems.

My setup is divided across 2 hard drives - node is installed on my SSD (with my OS), and my project (and it's node_modules, where I'm trying to execute nodemon from is on my storage-HDD.

sh: 1: nodemon: Permission denied

npm ERR! Linux 3.19.0-56-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v5.9.0
npm ERR! npm  v3.7.3
npm ERR! code ELIFECYCLE
npm ERR! vyggo-easyrtc@1.0.0 start: `nodemon --exec node entry`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the vyggo-easyrtc@1.0.0 start script 'nodemon --exec node entry'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vyggo-easyrtc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nodemon --exec node entry
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vyggo-easyrtc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vyggo-easyrtc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /media/goatic/HDD/Projects/Node/vyggo-easyrtc/npm-debug.log
goatic@goatic-laptop:/media/goatic/HDD/Projects/Node/vyggo-easyrtc$
Thomas Bormans
  • 5,156
  • 6
  • 34
  • 51
Goatic
  • 323
  • 1
  • 2
  • 9

6 Answers6

33

I had this problem after changing moving my project from an NTFS filesystem to linux. I changed all the file/directory permissions to 644/755 and also set the owner/group. That's when I started getting this error.

When I tried nodemon in the terminal, I got command not found. Strange.

Reinstalling nodemon fixed it:

sudo npm install -g nodemon
ki9
  • 5,183
  • 5
  • 37
  • 48
7

My secondary drive was incompatible with my linux OS in terms of permissions, as it was an NTFS partition.

I ended up moving everything to my primary drive, and of course permissions were working again, allowing me to execute local dependencies.

I guess the solution to my problem, had I relied on keeping projects on the secondary drive, would be to format it to a format compatible with Linux permissions.

Goatic
  • 323
  • 1
  • 2
  • 9
5

I had the same problem. In my case when I changed my operating system to Linux Ubuntu, 20.04.1 Version, reinstalling nodemon solved the problem.

For Linux users:

sudo npm install -g nodemon 

for Windows users, open a new terminal or cmd prompt just write:

npm install -g nodemon

For more information check nodemon documentation:

nodemon documentation

Jackdaw
  • 7,626
  • 5
  • 15
  • 33
pedram
  • 181
  • 2
  • 8
4

If you are installing in MAC Use.

sudo npm install -g nodemon --unsafe-perm.

It will work.

Yogendra Singh
  • 2,063
  • 25
  • 20
1

I counter this problem when I git clone a project which initially created on a Windows machine, my simple solution is to delete the .node_modules directory and then run npm install, which solved my problem.

Cheng
  • 11
  • 1
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/33007802) – L8R Oct 27 '22 at 17:30
0

very weird, I had the same problem except I solved it by replacing Nodemon devStart with nodemon devStart and suddenly the error was gone :)