运行npm run dev报错,找了好的方法都不好用,求大神!!!
发布于 3 个月前 作者 banyungong 308 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

hongyu@1.0.0 dev /Users/tanchang/www/vue/hongyu
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

/Users/tanchang/www/vue/hongyu/build/webpack.dev.conf.js:53
new webpack.NoEmitOnErrorsPlugin(),
^

TypeError: webpack.NoEmitOnErrorsPlugin is not a constructor
at Object. (/Users/tanchang/www/vue/hongyu/build/webpack.dev.conf.js:53:5)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at module.exports (/Users/tanchang/www/vue/hongyu/node_modules/webpack/bin/convert-argv.js:80:13)
at Object. (/Users/tanchang/www/vue/hongyu/node_modules/webpack-dev-server/bin/webpack-dev-server.js:68:48)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hongyu@1.0.0 dev: webpack-dev-server \--inline \--progress \--config build/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hongyu@1.0.0 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! /Users/tanchang/.npm/_logs/2019-07-17T07_13_20_165Z-debug.log

3 回复

github.com/PanJiaChen/vue-element-admin

Issue: webpack.NoEmitOnErrorsPlugin is not a constructor 执行npm run build:prod报这个错误

opened by junge68 on 2017-07-16
closed by PanJiaChen on 2017-07-18

估计和webpack的版本有关系,看一下版本。然后重新npm install。
不行的话就升级或降级webpack的版本。

解决了解决了,一直以为是webpack版本问题,结果是公司这网今天不行,下载依赖没下载全,回家重安一下就好了!!!

建议删除node_modules,重新npm install ,再重新npm run dev ,不行的话,使用yarn试一下

回到顶部