我try 运行npm run dev,但出现以下错误:

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 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.

this is the error log:

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 ]

I'm using laravel 5.7mix.

node version: v11.10.0 npm version: 6.7.0

any help please?

推荐答案

Ok I figure out the problem, the storage where the project is saved is auto-mounted and it have no execution permission.

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

Laravel相关问答推荐

Nuxt 3获取多部分表单数据上传不起作用

在Laravel Livewire中,如果一个输入基于另一个唯一的字段是唯一的,如何判断验证?

到查询构建器的MySQL查询

如何在控制器中获取所需参数?

Laravel where 子句只返回一个数据库条目

集成测试模拟外观与注入模拟

Guzzle - Laravel如何使用 x-www-form-url-encoded 发出请求

限制 Blade foreach 循环中的结果

如何在 Laravel 5.5 中扩展 vendor 包服务提供者

在 laravel 如何将额外的数据传递给 mutators 和 accessors

Laravel 5.3 auth 判断构造函数返回 false

Laravel 扩展验证自定义消息

如何在 Laravel 中为模型命名,以免与现有类发生冲突?

反向代理后面的 Laravel 路由

Select,where JSON 包含数组

我在哪里放置可以显示 Flash 消息的 Laravel 4 辅助函数?

在 vue.js 中使用 Laravel 的Gate/Authorization

Carbon解析到 ISO8601

如何在 Laravel 中 Refresh刷新用户对象?

Laravel Route 模型与关系绑定