Reprinted: TypeError: Can not read property 'compilation' of undefined vue packed run npm run build error

Reprinted from: https://www.jianshu.com/p/3f8f60e01797

When run npm run build package, given as follows:

 

My package.json as follows:

 1 {
 2   ...
 3   "devDependencies": {
 4     "autoprefixer": "^7.1.2",
 5     "babel-core": "^6.22.1",
 6     "babel-eslint": "^8.2.1",
 7     "babel-helper-vue-jsx-merge-props": "^2.0.3",
 8     "babel-loader": "^7.1.1",
 9     "babel-plugin-syntax-jsx": "^6.18.0",
10     "babel-plugin-transform-runtime": "^6.22.0",
11     "babel-plugin-transform-vue-jsx": "^3.5.0",
12     "babel-preset-env": "^1.3.2",
13     "babel-preset-stage-2": "^6.22.0",
14     "babel-register": "^6.22.0",
15     "chalk": "^2.0.1",
16     "chromedriver": "^2.27.2",
17     "copy-webpack-plugin": "^4.0.1",
18     "cross-spawn": "^5.0.1",
19     "css-loader": "^2.1.1",
20     "element-theme-chalk": "^2.8.2",
21     "element-ui": "^2.8.2",
22     "eslint": "^4.15.0",
23     "eslint-config-standard": "^10.2.1",
24     "eslint-friendly-formatter": "^3.0.0",
25     "eslint-loader": "^1.7.1",
26     "eslint-plugin-import": "^2.7.0",
27     "eslint-plugin-node": "^5.2.0",
28     "eslint-plugin-promise": "^3.4.0",
29     "eslint-plugin-standard": "^3.0.1",
30     "eslint-plugin-vue": "^4.0.0",
31     "extract-text-webpack-plugin": "^3.0.0",
32     "file-loader": "^1.1.11",
33     "friendly-errors-webpack-plugin": "^1.6.1",
34     "html-webpack-plugin": "^2.30.1",
35     "nightwatch": "^1.1.11",
36     "node-notifier": "^5.1.2",
37     "node-sass": "^4.12.0",
38     "optimize-css-assets-webpack-plugin": "^5.0.1",
39     "ora": "^1.2.0",
40     "portfinder": "^1.0.13",
41     "postcss-import": "^11.0.0",
42     "postcss-loader": "^2.0.8",
43     "postcss-url": "^7.2.1",
44     "rimraf": "^2.6.0",
45     "rxjs": "^6.5.2",
46     "rxjs-compat": "^6.5.2",
47     "sass-loader": "^7.1.0",
48     "selenium-server": "^3.0.1",
49     "semver": "^5.3.0",
50     "shelljs": "^0.7.6",
51     "style-loader": "^0.23.1",
52     "ts-loader": "^3.5.0",
53     "typescript": "^3.4.5",
54     "uglifyjs-webpack-plugin": "^1.1.1",
55     "url-loader": "^1.1.2",
56     "vue-class-component": "^7.1.0",
57     "vue-i18n": "^8.11.2",
58     "vue-i18n-extract": "^0.4.14",
59     "vue-loader": "^13.3.0",
60     "vue-property-decorator": "^8.1.1",
61     "vue-rx": "^6.2.0",
62     "vue-style-loader": "^3.0.1",
63     "vue-template-compiler": "^2.5.2",
64     "vuex": "^3.1.1",
65     "webpack": "^3.6.0",
66     "webpack-bundle-analyzer": "^3.3.2",
67     "webpack-dev-server": "^2.9.1",
68     "webpack-merge": "^4.1.0"
69   },
70   "engines": {
71     "node": ">= 6.0.0",
72     "npm": ">= 3.0.0"
73   },
74   "browserslist": [
75     "> 1%",
76     "last 2 versions",
77     "not ie <= 8"
78   ]
79 }
View Code
Then check the version information is found to the problem, webpack is version 3.6.0, but optimize-css-assets-webpack- plugin version 5.0.1. Later, to optimize-css-assets-webpack- plugin 3.2.0 instead of on it.
Execution npm i [email protected] can be changed in the version 3.2.0.
Note: If you perform npm i [email protected] the following prompt, after you finished, do not press the prompts, will optimize-css-assets-webpack- plugin revert to the original version, simply ignore prompt enough.

 

 

Reprinted from: https://www.jianshu.com/p/3f8f60e01797

Guess you like

Origin www.cnblogs.com/mySummer/p/11198755.html