Skip to content

"@babel/core@^7.0.0 is required" even though @babel/core is 7.x.x #217

@LeaVerou

Description

@LeaVerou

Here is the output of npm list:

├── @babel/[email protected]
├── @babel/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

And yet, when I try to use gulp-babel, I get:

[22:18:03] Error in plugin "gulp-babel"
Message:
    @babel/core@^7.0.0 is required
Details:
    domainEmitter: [object Object]
    domainThrown: false

I looked at the code that produces this error and then created this testcase:

const babel = require('@babel/core');

babel.loadPartialConfig({
	caller: undefined,
	babelrc: false,
	configFile: false
});

Running that gave me the culprit:

Error [BrowserslistError]: /Users/leaverou/Documents/mavo/mavo contains both .browserslistrc and package.json with browsers

Addressing that fixed my issue. However, this was a very frustrating debugging experience, as the error I was seeing was completely different from the actual error!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions