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

248
Vistas
Node engine 8.x or 10.x in package.json

I tried to specify the node engine in a package.json to accept both 8 and 10 version.

I tried to type this:

"engines": {
  "node": "8.x|10.x"
},

But running yarn results in:

The engine "node" is incompatible with this module. Expected version "8.x|10.x"

If I replace with:

"engines": {
  "node": "10.x"
},

... it works (i.e no error).

Is there a way to accept two versions of node engine in a package.json?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

See the documentation which includes examples.

Provide a space separated list of engines with greater/less than symbols.

{ 
  "engines" : { 
    "node" : ">=8.0.0 <11.0.0" 
  }
}
over 4 years ago · Santiago Trujillo Denunciar

0

You just need the double pipe || instead of a single.

"engines": {
  "node": "^8 || ^10"
}

Would match either v8.x.x or v10.x.x but not v9.

You can read more about it here https://docs.npmjs.com/files/package.json#dependencies

over 4 years ago · Santiago Trujillo Denunciar
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