简体   繁体   English

致命错误:生成 cmd ENOENT -- grunt serve

[英]Fatal Error: spawn cmd ENOENT -- grunt serve

I am trying to start my angular app using grunt serve command but I am getting Fatal error: spawn cmd ENOENT.我正在尝试使用grunt serve命令启动我的 angular 应用程序,但出现致命错误:spawn cmd ENOENT。

I used following commands to generate my Angular App我使用以下命令来生成我的 Angular 应用程序

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然后我使用grunt serve命令来启动我的应用程序

but its not working.但它不工作。

System Info: OS: Windows 7 64 bit npm version : 2.11.3系统信息:操作系统:Windows 7 64 位 npm 版本:2.11.3在此处输入图片说明

please help me, I gone through all the grunt documentation but no clue.请帮助我,我浏览了所有 grunt 文档,但没有任何线索。

Try the following possible solutions:尝试以下可能的解决方案:

  • Verify the npm folder exists at the following location C:\\Users\\My-UserName\\AppData\\Roaming\\npm验证 npm 文件夹存在于以下位置 C:\\Users\\My-UserName\\AppData\\Roaming\\npm
  • Try to run npm cache clean尝试运行 npm cache clean
  • Add C:\\Windows\\System32\\ to the PATH Environment variableC:\\Windows\\System32\\到 PATH 环境变量

Run grunt serve with cmd.exe instead of git bash.使用 cmd.exe 而不是 git bash 运行 grunt serve。 I have the same problem and have dealt with it in this way.我有同样的问题,并以这种方式处理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM