Cannot read property 'tap' of…

2018-09-18 06:37:20来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

 

E:\vue-project\vue-element-admin-master>npm run build:prod

vue-element-admin@3.8.1 build:prod E:\vue-project\vue-element-admin-master
cross-env NODE_ENV=production env_config=prod node build/build.js

  • building for prod environment...E:\vue-project\vue-element-admin-master\node_modules\script-ext-html-webpack-plugin\lib\plugin.js:50
    compilation.hooks.htmlWebpackPluginAlterAssetTags.tap(PLUGIN, alterAssetTags);
    ^

TypeError: Cannot read property 'tap' of undefined
at ScriptExtHtmlWebpackPlugin.compilationCallback (E:\vue-project\vue-element-admin-master\node_modules\script-ext-html-webpack-plugin\lib\plugin.js:50:57)
at SyncHook.eval [as call] (eval at create (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\HookCodeFactory.js:17:12), :11:1)
at SyncHook.lazyCompileHook [as _call] (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\Hook.js:35:21)
at Compiler.newCompilation (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:504:26)
at hooks.beforeCompile.callAsync.err (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:540:29)
at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\HookCodeFactory.js:24:12), :6:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\Hook.js:35:21)
at Compiler.compile (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:535:28)
at readRecords.err (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:274:11)
at Compiler.readRecords (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:402:11)
at hooks.run.callAsync.err (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:271:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\HookCodeFactory.js:24:12), :6:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\Hook.js:35:21)
at hooks.beforeRun.callAsync.err (E:\vue-project\vue-element-admin-master\node_modules\webpack\lib\Compiler.js:268:19)
at AsyncSeriesHook.eval [as callAsync] (eval at create (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\HookCodeFactory.js:24:12), :15:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (E:\vue-project\vue-element-admin-master\node_modules\tapable\lib\Hook.js:35:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element-admin@3.8.1 build:prod: cross-env NODE_ENV=production env_config=prod node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element-admin@3.8.1 build:prod 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\Administrator\AppData\Roaming\npm-cache_logs\2018-09-05T05_37_15_612Z-debug.log

 

解决方法:

  • set "html-webpack-plugin": "^4.0.0-alpha" => "4.0.0-alpha"
  • remove node_modules
  • remove package-lock.json
  • npm install

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:JS里面的懒加载(lazyload)

下一篇:let和const在es6中的异同点