requires a peer of webpack@^4.0.0 || ^5.0.0 but webpack@3.12.0 was installed
√ All packages installed (1 packages installed from npm registry, used 353ms(network 348ms), speed 211.54kB/s, json 4(73.62kB), tarball 0B)
PS D:\jeebiz-ui-element> requires a peer of webpack@^4.0.0 || ^5.0.0 but webpack@3.12.0 was install  

webpack-dev-server 需要webpack 4.0.0以上版本的支持,但是我的webpack才是3.12.0版本,版本不够。

果断拆卸

#全局拆卸webpack

cnpm uninstall webpack webpack-cli -g

然后

//全局安装webpack

cnpm install webpack webpack-cli -g

//因为webpack版本问题最好安装现目前的稳定版

$ npm install server@2.9.7"">webpack-dev-server@2.9.7 –save-dev

作者:Jeebiz  创建时间:2020-03-19 16:52
 更新时间:2024-07-02 22:15