webpack 中版本相容性問題錯誤總結

李文楊發表於2018-10-15

一定不要執行npm i  XXX  -g(-d) 一定要指定版本,儘量低版本,也不最新版本,會導致不相容和指令不一樣的問題。

1.安裝webpack-dev-server 報錯,說需要webpack-cli,原因,這兩個之中某一個版本太高。,重新安裝低版本

2.安裝webpack-cli ,然後還是不能使用,

3. npm WARN webpack-cli@3.0.8 requires a peer of webpack@^4.x.x but none is installed. You must install peer dependencies yourself.。。說明安裝的Webpack版本太高,切換到,---》》》》》》》》》"webpack": "^3.6.0",

4.最後安裝 "webpack-cli": "^3.0.0",

5.安裝"webpack-dev-server": "^2.9.1"

報錯總結:

【1】

npm WARN webpack-cli@3.0.8 requires a peer of webpack@^4.x.x but none is installed. You must install peer dependencies yourself.

【2】

npm WARN webpack-dev-middleware@3.1.3 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN webpack-dev-server@3.1.4 requires a peer of webpack@^4.0.0-beta.1 but none is installed. You must install peer dependencies yourself.

【3】

C:\Apache24\htdocs\example\Aproject\test\first-day\Vue-study\02-day\web-pack

> webpack-dev-server

The CLI moved into a separate package: webpack-cli.

Please install 'webpack-cli' in addition to webpack itself to use the CLI.

-> When using npm: npm install webpack-cli -D

-> When using yarn: yarn add webpack-cli -D
---------------------
作者:不正經的前端程式設計師
來源:CSDN
原文:https://blog.csdn.net/qq_27300101/article/details/80932670?utm_source=copy
版權宣告:本文為博主原創文章,轉載請附上博文連結!

相關文章