1

I recently just started getting back into web development and I had Node.js already installed on my computer. I was trying to run npm install -g live-server to work with npm's live server.

This is what was returned when i ran npm install -g live-server.

ashle@DESKTOP-PFHHR2C MINGW64 ~/Desktop/npmtest
$ npm install -g live-server
npm WARN deprecated opn@6.0.0: The package has been renamed to `open`
C:\Users\ashle\AppData\Roaming\npm\live-server -> C:\Users\ashle\AppData\Roaming\npm\node_modules\live-server\live-server.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\live-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ live-server@1.2.1
added 191 packages from 149 contributors in 22.221s

The install seemed to work fine; however, when I ran live-server I got the following error:

ashle@DESKTOP-PFHHR2C MINGW64 ~/Desktop/npmtest
$ live-server
Serving "C:\Users\ashle\Desktop\npmtest" at http://127.0.0.1:8080
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

I've already tried removing Node.js completely from Windows using this (https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows) as a guide; however, once I installed node and the live server again, it still returned the same error.

I've checked the PATH to make sure C:\Users\Webmaster\AppData\Roaming\npm was in there. Maybe something went wrong there as I accidentally deleted all the other environment variables or maybe I'm completely oblivious to something I'm doing wrong? Has anyone else experienced this issue?

Edit: I also tried installing gulp. Said packages were installed then when I tried to run it, the same message popped up, so I don't think its an issue exclusive to the live server.

0

It was an issue with the environment variables.

Since I accidentally cleared everything had to add back C:\Windows\System32\ to the path and then restart. Live server works now.

https://stackoverflow.com/questions/28624686/get-spawn-cmd-enoent-when-try-to-build-cordova-application-event-js85

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.