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

188
Vistas
How to prevent npm from installing different versions of the same package?

For example, given two node modules, a and b.

a/package.json

{
  "name": "a",
  "version": "1.0.0",
  "dependencies": {
    "fastify": "3.24.0"
  }
}

b/package.json

{
  "name": "b",
  "version": "1.0.0",
  "dependencies": {
    "a": "*",
    "fastify": "^3.24.0"
  }
}

After running npm install in b, there are two versions of fastify in b's node_modules. One is node_modules/fastify (3.25.0), the other is node_modules/a/node_modules/fastify (3.24.0), which makes the instances created by fastify in the two modules (a and b) respectively belong to different classes and causes problems.

It's weird that npm doesn't just choose to use one version (such as 3.24.0) of the same package that fits all semver conditions.

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