question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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,

See original GitHub issue

Bug Report

After upgrading to babel7.0 from babel6.0 according to https://github.com/babel/babel-upgrade, I got an error, error output:

/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/@babel/helper-plugin-utils/lib/index.js:72
  throw Object.assign(err, {
  ^

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/resource/BeiKe/pikachu-static-front-owner/node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
    at Object.assertVersion (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/@babel/helper-plugin-utils/lib/index.js:13:11)
    at _default (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/@babel/plugin-transform-runtime/lib/index.js:46:7)
    at /Users/resource/BeiKe/pikachu-static-front-owner/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at Function.memoisePluginContainer (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
    at Function.normalisePlugin (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
    at /Users/resource/BeiKe/pikachu-static-front-owner/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/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/lib/node.js:103:45)
    at loader (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at WEBPACK_OPTIONS (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/webpack-cli/bin/convert-argv.js:133:13)
    at requireConfig (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/webpack-cli/bin/convert-argv.js:135:6)
    at /Users/resource/BeiKe/pikachu-static-front-owner/node_modules/webpack-cli/bin/convert-argv.js:142:17
    at Array.forEach (<anonymous>)
    at module.exports (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/webpack-cli/bin/convert-argv.js:140:15)
    at Object.<anonymous> (/Users/resource/BeiKe/pikachu-static-front-owner/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:40)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mbloanh5@0.0.1 start: `webpack-dev-server --config ./webpack/webpack.config.dev.babel.js`
npm ERR! Exit status 1

Current Behavior

My package.json:


"dependencies": {

 "antd-mobile": "^2.2.11",

 "axios": "^0.18.0",

 "child\_process": "^1.0.2",

 "classnames": "^2.2.6",

 "eslint-friendly-formatter": "^4.0.1",

 "fastclick": "^1.0.6",

 "glue-redux": "1.1.8",

 "history": "^4.7.2",

 "js-pinyin": "^0.1.9",

 "lodash": "^4.17.10",

 "node-schedule": "^1.3.2",

 "prettier": "^1.14.0",

 "progress": "^2.0.3",

 "prop-types": "^15.6.2",

 "react": "^16.4.1",

 "react-dom": "^16.4.1",

 "react-loadable": "^5.4.0",

 "react-redux": "^5.0.7",

 "react-router": "^4.3.1",

 "react-router-dom": "^4.3.1",

 "react-router-redux": "^5.0.0-alpha.9",

 "react-sticky": "^6.0.3",

 "redux": "^3.5.2",

 "redux-thunk": "^2.3.0",

 "weixin-js-sdk": "^1.4.0-test"

 },

 "devDependencies": {

 "@babel/cli": "^7.0.0",

 "@babel/core": "^7.0.0",

 "babel-core": "7.0.0-bridge.0",

 "@babel/plugin-proposal-class-properties": "^7.0.0",

 "@babel/plugin-proposal-object-rest-spread": "^7.0.0",

 "@babel/plugin-syntax-dynamic-import": "^7.0.0",

 "@babel/plugin-transform-member-expression-literals": "^7.0.0",

 "@babel/plugin-transform-property-literals": "^7.0.0",

 "@babel/plugin-transform-runtime": "^7.0.0",

 "@babel/polyfill": "^7.0.0",

 "@babel/preset-env": "^7.0.0",

 "@babel/preset-react": "^7.0.0",

 "@babel/runtime-corejs2": "^7.0.0",

 "autoprefixer": "^7.1.1",

 "babel-eslint": "^9.0.0",

 "babel-loader": "^8.0.0",

 "babel-plugin-import": "^1.12.0",

 "clean-webpack-plugin": "^0.1.19",

 "copy-webpack-plugin": "^5.0.3",

 "css-loader": "^0.28.11",

 "eslint": "^4.19.1",

 "eslint-config-standard": "^12.0.0",

 "eslint-config-standard-react": "^7.0.2",

 "eslint-loader": "^2.0.0",

 "eslint-plugin-flowtype": "^3.2.0",

 "eslint-plugin-import": "^2.17.2",

 "eslint-plugin-jsx-a11y": "^6.0.3",

 "eslint-plugin-node": "^9.1.0",

 "eslint-plugin-promise": "^4.1.1",

 "eslint-plugin-react": "^7.13.0",

 "eslint-plugin-standard": "^4.0.0",

 "file-loader": "^1.1.11",

 "html-webpack-plugin": "^3.2.0",

 "less": "^3.0.4",

 "less-loader": "^4.1.0",

 "mini-css-extract-plugin": "^0.4.1",

 "optimize-css-assets-webpack-plugin": "^3.2.0",

 "postcss-flexbugs-fixes": "^3.3.1",

 "postcss-loader": "^2.1.5",

 "px2rem-loader": "^0.1.9",

 "redux-devtools": "^3.4.1",

 "redux-devtools-dock-monitor": "^1.1.3",

 "redux-devtools-log-monitor": "^1.4.0",

 "source-map-loader": "^0.2.3",

 "style-loader": "^0.21.0",

 "svg-inline-loader": "^0.8.0",

 "uglifyjs-webpack-plugin": "^1.2.7",

 "url-loader": "^1.0.1",

 "vconsole": "^3.3.0",

 "webpack": "4.15.0",

 "webpack-bundle-analyzer": "^3.3.2",

 "webpack-cli": "^2.0.4",

 "webpack-dev-server": "^3.1.4",

 "webpack-manifest-plugin": "^2.0.3"

 }

Input Code None

Expected behavior/code None

Environment

  • Babel version(s): 7.4.5
  • Node/npm version: v8.16.0
  • OS: MacOs

Possible Solution None

Additional context/Screenshots None

then i fond an issues: 10108, but when run

npx nls why babel-core 

output:

npx: 28 安装成功,用时 11.013 秒

nothing else.

How do I update babel-core@6.26.3 to babel-core@7.0.0?

and i dont know what should i do ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
houchaoweicommented, Mar 27, 2020

@nicolo-ribaudo tks! follow your words, it works.

1reaction
nicolo-ribaudocommented, Mar 27, 2020

Remove the polyfill option from @babel/plugin-transform-runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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...
Read more >
Requires Babel “7.0.0-0” but was loaded with “6.26.3” - GitHub
If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the...
Read more >
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...
Read more >
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
an old version of Babel. 3. ​. 4. One way around if Babel6 is required by the dependency: 5. $ npm install babel-core@^7.0.0-bridge...
Read more >
babel/register - Babel.js
Compiling plugins and presets on the fly. @babel/register uses Node's require() hook system to compile files on the fly when they are loaded....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found