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

176
Vistas
Grep package.json dependency versions and interpolate them in a MakeFile

I am trying to get the current dependencies and devDependencies versions that are set in the package.json file so that when the MakeFile is run for a new user, it installs the versions listed there and not just the latest version. So for the example below, instead of just saying npm install @applitools/eyes-testcafe we would grab the version 1.16.1 from the package.json and interpolate it there in the MakeFile like ${eyes_version} or something like that.

Any idea on how to do this? Thanks!

package.json

"devDependencies": {
        "@applitools/eyes-testcafe": "^1.16.1",
        "testcafe": "^1.18.6",
        "testcafe-reporter-xunit": "*"
}

MakeFile

install-testcafe: npm ffmpeg applitools testcafe

# Installs all dependencies necessary for testcafe and node to run.
npm:
    npm install

# Installs the ffmpeg video recorder. This is recursive as sometimes it doesn't install automatically.
ffmpeg:
    npm install @ffmpeg-installer/ffmpeg

# Installs the applitools dependency. This is recursive as sometimes it doesn't install automatically.
applitools:
    npm install @applitools/eyes-testcafe

# Installs TestCafe globally. This is recursive as sometimes it doesn't install automatically.
testcafe:
    sudo npm install -g testcafe
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Since you are using jq,

jq '.devDependencies["@applitools/eyes-testcafe"]' package.json

Is it useful?

I question the validity/usefulness of using a Make wrapper around NPM. You're wrapping a build tool in a build tool. Why? I'm guessing to make it more familiar to developers coming from a C/Make ecosystem. But mixing Make and NPM like this confuses Node/NPM developers, and NPM scripts can run CLI commands just like Make does.

Is npm i really more complicated than make npm? Seems like this information is better off in a README, and Make developers should be educated on how to use NPM (e.g. you can run CLI commands from inside NPM scripts). Adding Make scripts isn't adding any value here, but YMMV, maybe this is particularly useful inside your org.

Also don't use sudo when running npm.

about 4 years ago · Juan Pablo Isaza 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