Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Permission Denied" in Node on Linux, when running start-script /w local nodemon/mocha/babel-node

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! [email protected] start: `nodemon --exec node entry`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the [email protected] 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$
like image 715
Goatic Avatar asked Mar 21 '16 10:03

Goatic


2 Answers

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
like image 187
Keith Avatar answered Sep 18 '22 15:09

Keith


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.

like image 22
Goatic Avatar answered Sep 21 '22 15:09

Goatic