Unhandled error after the command "ng serve –open"

I am trying to use Angular and while following the getting started guide I am getting an error at step 3, that is when I run the ng serve --open command. it shows compiles successfully but then the error pops up which is:

events.js:170
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:247:19)
    at onErrorNT (internal/child_process.js:431:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:253:12)
    at onErrorNT (internal/child_process.js:431:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

Source: AngularJS