Cannot read property 'tap' of undefined
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
推荐阅读
-
js报错 Cannot read property 'getAttribute' of null
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object
-
npm ERR! Cannot read property 'path' of null
-
js报错 Cannot read property 'getAttribute' of null
-
微信小程序报Cannot read property 'setData' of undefined的错误
-
webpack报错Cannot read property 'presetToOptions' of undefined
-
Extjs4---Uncaught TypeError: Cannot read property ‘items’ of undefined
-
JavaScript Uncaught TypeError: Cannot read property 'value' of null
-
Cannot read property 'tap' of undefined
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#