Me gustaría ejecutar varios scripts uno tras otro, así que creé scripts en el archivo package.json
:
"scripts": { "predeploy": "yarn build", "deploy": "gh-pages -d build", "deploy-windows": "yarn build; gh-pages -d build" }
En Mac funciona bien, así que si escribo yarn deploy
, ejecuta yarn build
y gh-pages -d build
after.
En Windows tengo un problema porque me sale este error:
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: [] }
¿Cómo puedo arreglar eso? Cuando ejecuto yarn build
y gh-pages -d build
por separado, funciona bien, pero no puedo ejecutarlos en un script en Windows.