headcr4sh / node-maven

Maven for Node.js
Apache License 2.0
18 stars 14 forks source link

Crashes with Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT #26

Closed pszalanski closed 4 years ago

pszalanski commented 4 years ago

Hi there,

I tried using your maven wrapper on windows 10 and it simply crashes with

Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn C:\\WINDOWS\\system32\\cmd.exe',
  path: 'C:\\WINDOWS\\system32\\cmd.exe',
  spawnargs: [ '/s', '/c', 'mvn', '-q', '-B', 'compile' ]
}

Googling that error did not turn up anything useful. My cwd is correct and my ComSpec environment variable does not end with a semicolon.

Do you have any advice on what to do?

pszalanski commented 4 years ago

I figured it out: My cwd was invalid after all. Sorry 😄

Still, I will switch to using cross-spawn myself, because I need the stdout output of the maven command and I cannot seem to find out how to do it with this maven wrapper.