vue项目 vue-cli npm run build 报错 无法生成dist文件夹 求教如何解决

下面是执行npm run build命令时完整的报错信息
好像是因为uglifyjs-webpack-plugin这个模块,看了下之前的项目没有找到这个模块,这次新项目好像自动生成了这个

module.js:549

throw err;
^

Error: Cannot find module 'uglifyjs-webpack-plugin'

at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\work\git\ningxia-base-front\build\webpack.prod.conf.js:12:24)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\work\git\ningxia-base-front\build\build.js:12:23)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ningxia-base-front@1.0.0 build: node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ningxia-base-front@1.0.0 build 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! C:Users姜可薇AppDataRoamingnpm-cache_logs2019-03-26T03_19_03_313Z-debug.log

阅读 3.4k
1 个回答

uglifyjs-webpack-plugin没找到。
你的webopack配置文件和webpack版本可以发出来看下,就知道哪出问题了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题