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

285
Vistas
Unable to run any child processes with npm

I'm trying to install packages for a work repo, however whenever I try to run the install, once it gets to the child processes (like running install scripts for a package) I get a weird spawn error. I'm assuming it's having issues running the child processes.

Some information:

  • Windows machine
  • Node v12.22.3 and npm v6.14.13 (I've tried node 14)
  • Tried using bash, windows terminal, cmd prompt, and powershell (all with admin)
  • Error code seems to be a 4058 but I'm not sure what it can't find

It was working fine just last week, now suddenly I can't get anything done. I've tried the following:

  • Turning off the Work AV
  • Removing node_modules and package-lock
  • Running npm cache clear --force and npm cache verify
  • Uninstalling node and reinstalling
  • Completely uninstalling nvm and node and reinstalling

The error I see is:

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn =
npm ERR! file =
npm ERR! path =
npm ERR! errno ENOENT
npm ERR! root@ prepare: `husky install`
npm ERR! spawn = ENOENT
npm ERR!
npm ERR! Failed at the root@ prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dhers\AppData\Roaming\npm-cache\_logs\2021-07-19T18_28_56_807Z-debug.log

Do note this is NOT a husky problem, anything that runs a child process script seems to have this error happen.

I've never seen this before and I'm unable to fix it with the googling I've done. Here is some information from the npm log:

59 silly lifecycle root@~prepare: Args: [ '-c', 'husky install' ]
60 info lifecycle root@~prepare: Failed to exec prepare script
61 silly lifecycle root@~prepare: Returned: code: -4058  signal: null
62 info lifecycle root@~prepare: Failed to exec prepare script
63 verbose stack Error: root@ prepare: `husky install`
63 verbose stack spawn = ENOENT
63 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
63 verbose stack     at onErrorNT (internal/child_process.js:470:16)
63 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
64 verbose pkgid root@
65 verbose cwd C:\Users\dhers\Documents\Development\Work\seamless
66 verbose Windows_NT 10.0.19042
67 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
68 verbose node v12.22.3
69 verbose npm  v6.14.13

Has anyone seen this before? I'm really hoping I'm just overlooking something super simple. Any help would be appreciated because this has me halted right now.

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

0

Make sure your system environment variables PATH contains the following values:

%SystemRoot%

%SystemRoot%\system32

%SystemRoot%\System32\Wbem

C:\Program Files\nodejs\

Also, make sure your User environment variables PATH contains the following value:

C:\Users\dhers\AppData\Roaming\npm

Note that you need to restart your computer for the changes to take effect.

over 4 years ago · Santiago Trujillo Denunciar

0

Maybe try the following:

  1. Clean the npm cache
npm cache clean --force
  1. Check the npm version you're using. Maybe it should be updated:
npm install -g npm@latest
  1. Try with another version of the package huskey
  2. For this specific scenario, try to skip huskey install through adding
export HUSKY_SKIP_INSTALL=true

to the npm install cmd just to see whether the problem persists with other prepare scripts.

  1. Add the script to the postinstall hook instead of the prepare hook to see if the problem is from the hook.

  2. Go up level by level in your working directory and make sure there are no other directories containing /node_modules directory or package.json or a pakcage-lock.json file. Sometimes npm considers it the root of the project.

over 4 years ago · Santiago Trujillo Denunciar

0

Delete package-lock.json and node_modules

Execute npm cache clean --force

Execute npm install or yarn install

Then again run

maybe the wrong is your dependencies, check in your package.json and your npm local is not the correct

"dependencies": {
  "npm": "^7.5.6",

then you can try with yarn, yarn install

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