NPM ruin dev 报错,问题可能存在于 mix 这个 module 里,尝试解决了两个星期未果

下面是报错信息,我怀疑是mix的问题,卡了好长时间了

vagrant@homestead:~/Code/weibo$ npm run dev

> @ dev /home/vagrant/Code/weibo
> npm run development

> @ development /home/vagrant/Code/weibo
> NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 78% module and chunk tree optimization unnamed compat plugin/home/vagrant/Code/weibo/node_modules/webpack/lib/Chunk.js:849
                throw new Error(
                ^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (/home/vagrant/Code/weibo/node_modules/webpack/lib/Chunk.js:849:9)
    at /home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
    at Array.forEach (<anonymous>)
    at /home/vagrant/Code/weibo/node_modules/laravel-mix/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/vagrant/Code/weibo/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook (/home/vagrant/Code/weibo/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/home/vagrant/Code/weibo/node_modules/webpack/lib/Compilation.js:1244:27)
    at hooks.make.callAsync.err (/home/vagrant/Code/weibo/node_modules/webpack/lib/Compiler.js:624:17)
    at _err0 (eval at create (/home/vagrant/Code/weibo/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:11:1)
    at _addModuleChain (/home/vagrant/Code/weibo/node_modules/webpack/lib/Compilation.js:1095:12)
    at processModuleDependencies.err (/home/vagrant/Code/weibo/node_modules/webpack/lib/Compilation.js:1007:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `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 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/vagrant/.npm/_logs/2019-02-21T07_46_51_048Z-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/vagrant/.npm/_logs/2019-02-21T07_46_51_083Z-debug.log

starkoverflow上有个兄弟和我的报错几乎一致,不过没人回答他的问题:https://stackoverflow.com/questions/545924...

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 4

快绝望了,哪位老哥能帮帮我 :cry:

5年前 评论

给你提供两种解决办法

1.尝试将 npm 镜像换成淘宝镜像,参考 http://npm.taobao.org/

2.安装 yarn,参考 https://yarn.bootcss.com/,用 yarn run dev 代替 npm run dev

5年前 评论

5.8版本也是这样的报错。

4年前 评论

我也遇到同样的问题,已经解决,贴上我的所有依赖包,重新安装一下就好了

"devDependencies": {
"axios": "^0.16.2",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.0.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"jquery": "^3.1.1",
"laravel-mix": "^4.1.4",
"lodash": "^4.17.4",
"resolve-url-loader": "^3.1.0",
"sass": "^1.23.0",
"sass-loader": "^7.3.1",
"vue": "^2.6.10",
"webpack-cli": "^2.1.5"
},
"dependencies": {
"@websanova/vue-auth": "^2.21.14-beta",
"css-loader": "^3.2.0",
"imagemin": "^5.0.0",
"node-pre-gyp": "^0.12.0",
"vue-axios": "^2.1.5",
"vue-loader": "^14.2.4",
"vue-router": "^3.1.3",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.0.0"
}

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!