webpack-babel解决[email protected] requires a peer of @babel/core@^7.0.0 版本兼容的问题

# 第一套包,相当于babel的转换工具
npm i babel-core babel-loader babel-plugin-transform-runtime -D
# 第二套包,babel的语法
npm i babel-preset-env babel-preset-stage-0 -D

## 安装第一个包出现报警告 [email protected] requires a peer of @babel/core@^7.0.0 原因如下:
# [email protected] is the Webpack integration used for Babel 7.x. Babel 7.x has moved all packages from a babel-prefix to the @babel npm scope.
# 解决办法就是 将[email protected]降级为[email protected]
# npm uninstall babel-loader -D
# npm i babel-loader@7 -D
# 或者一开始就直接为babel-loader指定到@7版本
# npm i babel-core babel-loader@7 babel-plugin-transform-runtime -D


你可能感兴趣的:(webpack,前端构建工具,babel,版本兼容)