Requires Babel ^7.0.0 0, but was loaded with 6.26.3. If you are sure you have a compatible versi

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 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.

在这里插入图片描述

参考:https://github.com/FormidableLabs/spectacle/issues/522
运行了npm i -D jest babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime

结果又遇到Error: Plugin/Preset files are not allowed to export objects, only functions.
在这里插入图片描述
网上查说是依赖版本不对
此时我的依赖
Requires Babel ^7.0.0 0, but was loaded with 6.26.3. If you are sure you have a compatible versi_第1张图片
在https://www.npmjs.com/package/babel-preset-stage-0查看历史版本
使用:npm i babel-preset-stage-0@next
安装"babel-preset-stage-0": “^7.0.0-beta.3”

结果又遇到
Error: The ‘decorators’ plugin requires a ‘decoratorsBeforeExport’ option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the ‘decorators-legacy’ plugin instead of ‘decorators’.在这里插入图片描述

错错无穷也

你可能感兴趣的:(前端)