Laravel Mix npm run dev 错误 ELIFECYCLE 在服务器上

标签 laravel npm webpack laravel-mix

我们有一个 Laravel 应用程序,并使用 Laravel Mix 作为我们的构建系统。在运行 npm run dev 时,我们的服务器上会出现错误,即使同样的事情在我们的本地笔记本电脑上运行得很好。这是怎么回事?

这是我们在控制台上得到的内容:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --verbose --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
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/ubuntu/.npm/_logs/2018-09-22T12_33_57_408Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
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/ubuntu/.npm/_logs/2018-09-22T12_33_57_425Z-debug.log

这是 npm 日志:

12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:961:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
...
20 error code ELIFECYCLE
21 error errno 1
22 error @ dev: `npm run development`
22 error Exit status 1

最佳答案

问题是服务器上的 RAM“耗尽”。这个错误很难调试,没有正确的错误消息。

关于Laravel Mix npm run dev 错误 ELIFECYCLE 在服务器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52456867/

相关文章:

拉拉维尔 5.1 : how can i update one row only with where clause?

node.js - npm install 导致无法读取未定义的属性 'name'

javascript - webpack css loader 不工作 : no output css file

node.js - NPM Start – 权限错误

javascript - 在 NPM 范围包中公开两个(或更多)Node.js Babel 类

webpack - 解析 Jest 中的文件路径

javascript - 如何在 Angular 4 项目中导入 bootstrap-daterangepicker?

php - stream_socket_sendto(): Connection refused

php - Corcel/Laravel Eloquent 模型获取多个 post_types 结果 | WordPress

Laravel - 如果在另一项服务中验证登录,如何在一项服务中进行 token 身份验证?