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

560
Vistas
Resolving module not found with Webpack (Module not found: Error: Can't resolve 'axios' in )

I have a package A which has dependency on say, axios. Package A builds independently and works fine. However, when I try to consume package A as a dependency in package B and try to compile, I am facing issue as below:

ERROR in ./node_modules/A/dist/impl/lifecycle-associate-tool-client-impl.js
Module not found: Error: Can't resolve 'axios' in '/workplace/LifeCycle/src/B/node_modules/A/dist/impl'
 @ ./node_modules/A/dist/impl/lifecycle-associate-tool-client-impl.js 17:32-48
 @ ./node_modules/A/dist/lifecycle-client-factory.js
 @ ./node_modules/A/dist/index.js
 @ ./src/api-clients/lifecycles/lifecycles.module.ts
 @ ./src/application.ts

In node_modules folder at the src level of package B, I have package A and inside of package A's node_modules, I have axios.

What I am aware of is that NPM resolves dependencies by looking at node_modules directory and then looking at parent if not found. But how to resolve this inward dependency situation?

Could webpack help to resolve the axios dependency by providing path in the resolve module to look axios in the node_modules, like below?

resolve: {
    alias: {
      src: path.resolve(__dirname, "..", "src"),
    },
    modules: [path.resolve(__dirname, "..", 'src'), 'node_modules'],
    extensions: [".js", ".jsx", ".ts", ".tsx", ".json"],
  }

I don't want to specify axios as dependency in package.json of package B.

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