I want to let the backend node run es6 through babel-node. As a result, after installing babel-cli, I always report Requires Babel "^ 7.0.0-0" and but was loaded with "6.26.3". The details are as follows:
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.
at throwVersionError (/Users/apple/HBuilderXProjects/travel-house/node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/Users/apple/HBuilderXProjects/travel-house/node_modules/@babel/helper-plugin-utils/lib/index.js:13:11)
at _default (/Users/apple/HBuilderXProjects/travel-house/node_modules/@babel/plugin-proposal-decorators/lib/index.js:43:7)
at /Users/apple/HBuilderXProjects/travel-house/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at Function.memoisePluginContainer (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
at Function.normalisePlugin (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
at /Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/lib/node.js:103:45)
at loader (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-register/lib/node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at Object.<anonymous> (/Users/apple/HBuilderXProjects/travel-house/node_modules/babel-cli/lib/_babel-node.js:154:22)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
my package.json configuration is as follows
"dependencies": {
"@babel/cli": "^7.2.3",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/runtime": "^7.2.0",
"@svgr/webpack": "2.4.1",
"antd": "^3.12.1",
"babel-cli": "^6.26.0",
"babel-eslint": "9.0.0",
"babel-jest": "^23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-import": "^1.8.0",
"babel-plugin-named-asset-import": "^0.3.0",
"babel-preset-react-app": "^7.0.0",
"bfj": "6.1.1",
...
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-decorators": "^7.2.3",
"@babel/preset-env": "^7.2.3",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-import": "^1.11.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"jest": "^23.6.0"
}
I have been messing around for hours, trying everything I can try on the Internet, but this is still the wrong report! Please help the gods!