我的新linux设置出现问题-我已将nodemon安装为本地依赖项(不在全局范围内),并且正在尝试从package.json“start” -script执行它。我收到此权限错误。node
本身可以很好地工作,但是一旦我尝试使用babel-node
或nodemon
甚至是mocha
,我就会遇到权限问题。
我的设置分为2个硬盘驱动器- Node 安装在我的SSD(带有操作系统)上,我的项目(和它的node_modules一起,我要从其中执行nodemon
的存储在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$
最佳答案
将项目从NTFS文件系统移动到linux后,出现了这个问题。我将所有文件/目录权限更改为644/755,还设置了所有者/组。那是我开始收到此错误的时间。
当我在终端中尝试nodemon时,我得到了command not found
。奇怪的。
重新安装nodemon修复了它:
sudo npm install -g nodemon
关于linux - 运行开始脚本/w local nodemon/mocha/babel-node时,在Linux上的Node中的"Permission Denied",我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36128086/