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

999
Vistas
Node package.json script not running on windows - Cannot find module yarn.js

I would like to run multiple scripts one after another so I created scripts in package.json file:

"scripts": {
  "predeploy": "yarn build",
  "deploy": "gh-pages -d build",
  "deploy-windows": "yarn build; gh-pages -d build"
 }

On Mac it is working fine so if I type yarn deploy it runs yarn build and gh-pages -d build after.

On windows I have a problem because I get this error:

enter image description here

Error: Cannot find module 'C:\Users\username\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js'
     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
     at node:internal/main/run_main_module:17:47 {
   code: 'MODULE_NOT_FOUND',
   requireStack: []
}

How can I fix that? When I run yarn build and gh-pages -d build separately it works fine but I cannot run them in one script on Windows.

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