node编译错误TypeError: Cannot read property 'compilation' of undefined

问题描述

/xxxxxxx/node_modules/last-call-webpack-plugin/src/index.js:170
    compiler.hooks.compilation.tap(
                   ^

TypeError: Cannot read property 'compilation' of undefined
    at OptimizeCssAssetsWebpackPlugin.apply (/xxxxxlast-call-webpack-plugin/src/index.js:170:20)
    at Compiler.apply (/xxxxx/node_modules/tapable/lib/Tapable.js:375:16)
    at webpack (xxx-/node_modules/webpack/lib/webpack.js:33:19)
    at err (/xxxxx/build/build.js:19:3)
    at next (/xxxx/node_modules/rimraf/rimraf.js:83:7)
    at CB (/xxxxx/node_modules/rimraf/rimraf.js:119:9)
    at /xxxxc/node_modules/rimraf/rimraf.js:145:14
    at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-webpack@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vue-webpack@1.0.0 build script.

解决方法

1、找到package.json
确定webpack版本和optimize-css-assets-webpack-plugin
webpack是3.6.0  
optimize-css-assets-webpack-plugin(5.0.3) 应该修改为3.2.0版本
运行 npm i [email protected]就刻印重新编译了

你可能感兴趣的:(centos7,jenkins,node)