今天看了掘金上的一篇文章(https://juejin.im/post/5bf61082f265da616a474b5c#comment),想搞搞webpack拆分js。

开搞

文章中用了webpack命令,所以要全局安装webpack啊,坑来了,别直接  npm i webpack -g 这样会安装最新的webpack版本,后边安装webpack-cli你就哭了。

这样安装:npm i webpack@3.8.1 -g

然后 npm i webpack -D

然后 npm i webpack-cli -D

结束

总结报错内容:

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版本太高了。

参考:https://blog.csdn.net/qq_27300101/article/details/80932670

相关文章:

  • 2022-01-31
  • 2021-08-14
  • 2021-05-29
  • 2022-12-23
  • 2021-11-28
  • 2021-04-19
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2021-12-04
  • 2021-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-06-29
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案