Babel-eslint: Failed to load parser 'babel-eslint' declared in 'CLIOptions': Cannot find module 'babel-eslint'

Created on 11 Nov 2019  路  6Comments  路  Source: babel/babel-eslint

  • Node version
v10.16.3
  • npm/yarn version
npm 6.12.0
  • ESLint version (actual version, not the semver range)
6.6.0
  • babel-eslint version (actual version, not the semver range)
10.0.3
  • The config you're using when you run into this issue
const linter = new CLIEngine({
    fix: program.fix,
    ignorePattern: [],
    useEslintrc: false,
    parser: 'babel-eslint',
    parserOptions: {
        sourceType: 'module'
    },
    cwd: process.cwd(),
    env: ['browser'],
    plugins: [
        'html'
    ],
    rules,
});

.eslintrc.js

module.exports = {
    root: true,
    parser: 'babel-eslint',
    parserOptions: {
        sourceType: 'module'
    },
    env: {
        browser: true,
    },
    plugins: [
        'html'
    ],
    'rules': {}
};
  • How you're running ESLint (command line, editor plugin, etc.)
Run your own frame to run

Question

Failed to load parser 'babel-eslint' declared in 'CLIOptions': Cannot find module 'babel-eslint'

Sorry, English is not good.

All 6 comments

It's hard to triage what's going on with the limited information we have here. Could you also include the following (and any other info you think would be helpful!):

  • Node version
  • npm/yarn version
  • ESLint version (actual version, not the semver range)
  • babel-eslint version (actual version, not the semver range)
  • The config you're using when you run into this issue
  • How you're running ESLint (command line, editor plugin, etc.)

Thanks!

@qianzhangsheng solved on my end with downgrading eslint to v4.x:

npm -g i eslint@4

Thanks @dr-dimitru the same here I had to downgrade eslint.

@aeciolevy I'm still on [email protected], while latest is v7
Wonder why they won't make it compatible 馃

@dr-dimitru that's super weird. This has been pointed out 6 months ago. :(

Thank you for the PR. Now that @babel/eslint-parser has been released, we are making this repository read-only. If this is a change you would still like to advocate for, please reopen this in the babel/babel monorepo.

Was this page helpful?
0 / 5 - 0 ratings