欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Cannot read property 'tap' of undefined

程序员文章站 2022-04-20 19:26:31
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-mastercross-env NODE_EN ......

 

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