sh:1:cross-env:laravel mix上的权限被拒绝 [英] sh: 1: cross-env: Permission denied on laravel mix
问题描述
我正在尝试运行npm run dev
,但是会发生以下错误:
I'm trying to run npm run dev
but the following error occur:
sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/shanmaseen/.npm/_logs/2019-02-22T16_32_08_191Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/shanmaseen/.npm/_logs/2019-02-22T16_32_08_241Z-debug.log
我已经在互联网上搜索了一个星期,根本没有帮助!
I've been searching the internet for a week, nothing helped at all !
我什至尝试从package.json脚本中删除'cross-env',但随后发生webpack:权限被拒绝,这表明权限错误不是通过自身自身自身的en-env来实现的.
I even tried to remove 'cross-env' from package.json scripts, but then webpack: permission denied happened, indicating that the permission error is not by cross-env it self.
这是错误日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm@6.7.0
3 info using node@v11.10.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/media/e/www/mwar/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~dev: CWD: /media/e/www/mwar
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 126 signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 126
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:197:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:197:13)
13 verbose stack at maybeClose (internal/child_process.js:984:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid @
15 verbose cwd /media/e/www/mwar
16 verbose Linux 4.18.0-15-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
18 verbose node v11.10.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 126
22 error @ dev: `npm run development`
22 error Exit status 126
23 error Failed at the @ dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 126, true ]
我正在使用laravel 5.7mix.
I'm using laravel 5.7mix.
节点版本:v11.10.0 npm版本:6.7.0
node version: v11.10.0 npm version: 6.7.0
有什么帮助吗?
推荐答案
好了,我知道了问题所在,保存项目的存储是自动挂载的,并且没有执行权限.
Ok I figure out the problem, the storage where the project is saved is auto-mounted and it have no execution permission.
很容易在/etc/fstab文件中,我在安装选项中添加了exec
,就像这样:
easily in /etc/fstab file i added exec
in the mount option, like this:
auto,user,exec,utf8,uid=1000,gid=1000,rw 0 0
这篇关于sh:1:cross-env:laravel mix上的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!