laravel - Laravel Mix npm 在服务器上运行开发错误 ELIFECYCLE
问题描述
我们有一个 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
解决方案
您是否尝试删除项目中的 node_modules/ 文件夹?
rm -rf node_modules
然后跑...
npm install
推荐阅读
- c++ - 表示单个全局类实例的最佳方式是什么?
- flutter - Flutter websocket onOpen?
- c++ - 当输出与窗口宽度匹配时,Windows 控制台(conhost)会丢弃换行符
- selenium - 如何在 QAF 中设置代理
- angular11 - 如何通过服务在组件之间共享数据?
- r - R 的 group_by 如何与其他 dplyr 动词准确交互?
- r - 为什么 flexdashboard 侧边栏调整大小而不是所有列?
- python - 如何针对 2 个条件过滤数据帧的每个子集?
- jquery - 添加基于 scrollTop() 的类并将位置粘性用于导航栏时的问题
- javascript - 正在加载,请稍候 数据加载后消息不会隐藏