安装babel遇到的异常

时间:2021-09-12 16:40:51
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/cli中包含了@babel/node,但是版本比较低。最好重新安装一遍@babel/node

npm install -g @babel/node