6

I am trying to start my angular app using grunt serve command but I am getting Fatal error: spawn cmd ENOENT.

I used following commands to generate my Angular App

npm install -g yo grunt-cli bower
npm install -g generator-angular
yo angular
npm install
bower install

then i used grunt serve command to start my app

but its not working.

System Info: OS: Windows 7 64 bit npm version : 2.11.3enter image description here

please help me, I gone through all the grunt documentation but no clue.

Nagesh Sanika
  • 1,090
  • 1
  • 8
  • 16

2 Answers2

13

Try the following possible solutions:

  • Verify the npm folder exists at the following location C:\Users\My-UserName\AppData\Roaming\npm
  • Try to run npm cache clean
  • Add C:\Windows\System32\ to the PATH Environment variable
Luuk Moret
  • 506
  • 1
  • 6
  • 16
  • 2
    this started happening to me after a Windows update - which had cleared out the windows environment system path variable; re-adding C:\Windows\System32\ fixed it for me (I also had to add in C:\Windows\System32\ and c:\program files\nodejs before I even got to this error). – david.barkhuizen Sep 19 '15 at 11:34
  • Thanks a lot , this issue held me down for about a month i used another workaround to sort it out which is node express option .I just decided i must get to the bottom of the issue today and it is now resolved . I noticed it on my windows 10 box and i resolved it by simply adding C;Windows\System32 to my user and system environment . – I.Tyger Apr 08 '16 at 12:45
  • Thanks @Luuk Moret – Narendra Solanki Oct 11 '17 at 06:38
  • Slightly unrelated, but `C:\Windows\System32\ to the PATH` hint helped me resolve my issue with grunt-connect-proxy. Thanks a ton :) `Loading "connect_proxy.js" tasks...ERROR` – Anand Rockzz Oct 03 '18 at 20:15
1

Run grunt serve with cmd.exe instead of git bash. I have the same problem and have dealt with it in this way.

Pingting
  • 11
  • 2