babel / babel-eslint

:tokyo_tower: A wrapper for Babel's parser used for ESLint (renamed to @babel/eslint-parser)

Home Page:https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Pentium286 opened this issue · comments

  • 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.

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 eslint@4.19.1, 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.