-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current Behavior
I've tried to move to Babel 7 on existing simple project.
When I've finished migration I've got the error:
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.
Babel config for transformation the app is in /config/babelLoaderConfig.js
Here is link for the repository
Environment
- Babel version(s): v7.0.0-beta.51
- Node/npm version: Node 10.4./npm 6
- OS: Windows 7
- Monorepo yes
- How you are using Babel:
loader
wilk, zedtux, BritishWerewolf, nathanchere, thenengah and 4 more
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
babel-bot commentedon Jun 21, 2018
Hey @budarin! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.
xtuc commentedon Jun 21, 2018
I think that you're loading a plugin that uses Babel 6 which is not compatible with Babel 7.
budarin commentedon Jun 21, 2018
@xtuc
What is the solution?
Move back?
ajliv commentedon Jun 21, 2018
@budarin try installing babel-core@7.0.0-bridge.0 alongside @babel/core and then adding this to your package.json --
budarin commentedon Jun 21, 2018
@ajliv
I've tried but with the same error :(
loganfsmyth commentedon Jun 21, 2018
As mentioned in the error itself, the stack trace is the important part here to diagnose the issue. Please include that.
budarin commentedon Jun 21, 2018
Here is full log:
budarin commentedon Jun 21, 2018
Repo is changed (I have undo babel7 modifications to Babel 6), but you cold do checkout the head to reproduce the error
loganfsmyth commentedon Jun 21, 2018
Yeah, so you have
babel-register
which is Babel 6. It would be@babel/register
for Babel 7.budarin commentedon Jun 21, 2018
@loganfsmyth
I have not babel-register in package.json!
jsg2021 commentedon Jun 21, 2018
@budarin you have
babel-core
twice with different values. Try deleting the line:loganfsmyth commentedon Jun 21, 2018
@budarin Since you're using a
webpack.config.babel.js
file, Webpack loadsbabel-register
/@babel/register
automatically, but since you don't have it in you deps you're basically accidentally relying on npm to flatten your dependencies and you're getting one by chance.budarin commentedon Jun 21, 2018
@jsg2021
I have no
"babel-core": "^6.26.3",
- it's error while copy from commit log - not remove removed linebudarin commentedon Jun 21, 2018
@loganfsmyth
Should I manually install @babel/register to resolve the problem?
loganfsmyth commentedon Jun 21, 2018
Yep!
14 remaining items
jkalina commentedon Dec 5, 2018
For me, adding
"resolutions": { "babel-core": "^7.0.0-bridge" }
solved this issue.
fix babel/babel#8206
harmnot commentedon Feb 22, 2019
I have same issues like that and I already follow some methods on this conversions, but still get error like the first issues Budarin said
seyaobey commentedon Mar 1, 2019
Same issue here!
budarin commentedon Mar 1, 2019
Just add
"babel-core": "^7.0.0-bridge.0",
to your dependencies in packaje.json!harmnot commentedon Mar 4, 2019
it solved by adding this .babelrc
and then on package json ,
"start": "nodemon --exec babel-node index.js",
and don't forget to add new babel
ziedHamdi commentedon May 10, 2019
Same issue here:
my babel.rc
my package.json
vincro commentedon May 10, 2019
You need to add:
"babel-core": "^7.0.0-bridge.0",
to your dev dependencies.
qwertyhoge commentedon May 17, 2019
In my case, I read the stack trace to find
babel-register
in the global directory was called, and the global one's version was low so I met this issue.Then I installed
@babel/register
in the project directory and that worked.Samiys commentedon Jun 13, 2019
npm WARN react-starter@1.0.0 No repository field.
getting this error
GavinMoreYoung commentedon Jul 13, 2019
maybe you could install global babel-cli, you can try command : npm uninstall -g babel-cli babel-node.you need install @babel/cli and @babel/node.
OR
you can uninstall node and remove npm file in C:\Users\Administrator\AppData\Roaming
i hope i can help you.good luck
aamurtaza commentedon Jul 21, 2019
It worked for me.
npm uninstall -g babel-cli babel-node
then running
npm install -g @babel/cli @babel/node
It asked to install peer dependencies which was in my case "@babel/core: ^7.0.0 ". I installed it also globally.