在安装babel到 v7.0.0之后,使用babel命令偶尔会出现如下错误:
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
原因自然是因为babel核心和babel配置版本不匹配造成的。
而我自己因为以前全局安装过babel6,从而导致这个错误。
因此我先是全局卸载babel6,然后根据官网,更新babel核心 @babel/core @babel/cli 到 @^7.0.0 ,其余插件按需安装。
以下为搜索解决方案时查到的其余解决办法:
如果有其他插件强制使用了babel6,那么更新核心之后可能仍然无法解决问题,此时可以安装 babel-core@^7.0.0-bridge.0 解决。
npm i babel-core@7.0.0-bridge.0 -D
使用这种方法就不一定需要更新 @babel/cli 了
文章目录CentOS 8.0 安装docker
报
错
:Problem: package docker
-
ce
-
3:19.03.4
-
3.el7.x86_64
requires
containerd.io >= 1.2.2
-
31、
错
误内容2、分析原因3、
解决
4、检查是否安装成功
CentOS 8.0 安装docker
报
错
:Problem: package docker
-
ce
-
3:19.03.4
-
3.el7.x86_64
requires
containerd.io >= 1.2.2
-
3
1、
错
误内容
package docker
-
ce
-
3:19.03.2
-
3.el7.x86_64 require
彻底
解决
Error:
Requires
Babel
“
^
7.0.0
-
0”, but was
loaded
with “6.26.3”. 的问题
在
babel
升级到7以后,按照其官网的要求,安装了
babel
7.0相关的包,具体包括@
babel
/core, @
babel
/cli, @
babel
/@
babel
/preset
-
env,@
babel
/plugin
-
transform
-
runtime,@
babel
/plugin
-
proposal
-
class
-
properties, @
babel
/plugin
ERROR in ./src/renderer/main.js
Module build failed (from ./node_modules/
babel
-
loader/lib/index.js):
Error:
Requires
Babel
“
^
7.0.0
-
0”, but was
loaded
with “6.26.3”. If you are sure you have a compatible version of @
babel
/core, it is likely that something i
Requires
Babel
"
^
7.0.0
-
0", but was
loaded
with "6.26.3".
If you are sure you have a compatible version of @
babel
/core, it is likely that something in
your build process is loading the wrong version. Inspect the stack trace of this error to loo
k for
babel
is a javascript compiler
想通过
babel
-
node让后端node可以运行es6,结果装完
babel
-
cli总是
报
错
Requires
Babel
“
^
7.0.0
-
0”, but was
loaded
with “6.26.3”.具体如下:
下面是我的package.json文件
"name": "form
-
react",
"version": "1....
Error:
Requires
Babel
"
^
7.0.0
-
0", but was
loaded
with "6.26.3". If you are sure you have a compatible version of @
babel
/core, it is likely that something in your build process is loading the wron...
1、想通过
babel
-
node让后端node可以运行es6,结果装完
babel
-
cli总是
报
错
Requires
Babel
"
^
7.0.0
-
0", but was
loaded
with "6.26.3"yarnadd@
babel
/cli@
babel
/core@
babel
/node@
babel
/preset
-
env
-
D
https://segmentfault....