Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
Error: Failed to load plugin '@babel' declared in '--config

I've seen a few similar questions to this, but I think this issue is a little different.

I have shared ESLint config coming from a dependency, let's call it my-shared-config. The dependency contains a few plugins including @babel like so:

{
  env: { ... },
  plugins: [
    '@babel',
    'import',
    'inclusive-language',
    'react',
    'react-hooks',
  ],
  rules: { ... },
}

The package.json contains these dependencies, among others:

"dependencies": {
  "@babel/core": "7.17.0",
  "@babel/eslint-parser": "7.17.0",
  "@babel/eslint-plugin": "7.16.5",
  "@babel/preset-react": "7.16.7",
  "eslint": "8.8.0",
  "eslint-plugin-import": "2.25.4",
  "eslint-plugin-inclusive-language": "2.2.0",
  "eslint-plugin-react": "7.28.0",
  "eslint-plugin-react-hooks": "4.3.0"
},

For most projects, the shared config works. However, in one project when I run the linter, I get the following error:

Error: Failed to load plugin '@babel' declared in '--config » my-shared-config': Cannot find module '@babel/eslint-plugin'

The only difference with this project to the others - that I can think of - is that it also installs other @babel/ dependencies. My node_modules structure looks like this:

node_modules
  @babel # <-- BABEL
    code-frame
    compat-data
    core
    ...more, but nothing for ESLint
  @my-domain
    my-shared-config
      node_modules
        @babel  # <-- BABEL
          compat-data
          core
          eslint-parser # <-- BABEL ESLINT
          eslint-plugin # <-- BABEL ESLINT
          ...more

When I install @babel/eslint-parser and @babel/eslint-plugin into my project, the linter works fine. Whilst that's ok, it is obviously not a solution I want and I don't want other teams that use my-shared-config to have to do the same. Does anyone know of any other solutions for this problem? I've tried deleting and re-installing my node_modules.

I think this is likely to be an issue with Yarn rather than the Babel dependencies.

UPDATE

This issue only happens when the @babel/core versions are not exactly the same. After bumping the @babel/core version in my-shared-config, the linter throws the same error in other projects until it's own @babel/core version is the same.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda