【webpack 中版本兼容性问题错误总结,耽误半天学习】
【webpack版本兼容性問題錯誤總結,耽誤半天學習】
一定不要運行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
參考資料:
版本不兼容https://blog.csdn.net/weixin_39495540/article/details/79740790
https://www.cnblogs.com/carrotWu/p/8665720.html
https://www.npmjs.com/package/webpack-cli
總結
以上是生活随笔為你收集整理的【webpack 中版本兼容性问题错误总结,耽误半天学习】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 大白菜怎么安装gho镜像 使用GHO镜像
- 下一篇: 使用u盘前需要格式化该怎么处理 如何格式