简体   繁体   English

致命错误:生成cmd ENOENT-咕Ser服务

[英]Fatal error: spawn cmd ENOENT - Grunt Serve

When i run grunt serve i get this. 当我运行咕unt服务时,我得到了这个。

Running "browserSync:livereload" (browserSync) task
    [BS] Access URLs:
     ------------------------------------
           Local: http://localhost:9000
        External: http://192.168.1.5:9000
     ------------------------------------
              UI: http://localhost:3001
     UI External: http://192.168.1.5:3001
     ------------------------------------
    [BS] Serving files from: .tmp
    [BS] Serving files from: app
    [BS] Watching files...
    Fatal error: spawn cmd ENOENT

Hello Stackoverflow! 您好Stackoverflow! I have been trying get the yeoman-angular server running. 我一直在尝试运行yeoman-angular服务器。 I have got the server running before but now i keep getting this error. 我之前已经在运行服务器,但是现在我一直收到此错误。

I believe the major problem here is Spawn cmd ENOENT. 我相信这里的主要问题是Spawn cmd ENOENT。 I have googled the error but i still have no idea what to do. 我已经搜索了错误,但我仍然不知道该怎么办。 It seems my Path environment is messed up. 看来我的Path环境搞砸了。 Please help! 请帮忙!

I had this same error running grunt serve on a 64-bit Windows 7 system. 我在64位Windows 7系统上运行grunt服务时遇到了相同的错误。 I've never experienced this problem on my Macbook Air. 我从未在Macbook Air上遇到此问题。 What worked for me was right-clicking and opening the Command Prompt using "Run as Administrator." 对我有用的是右键单击并使用“以管理员身份运行”打开命令提示符。 I was then able to navigate to my project directory and run grunt serve without errors. 然后,我能够导航到我的项目目录并运行grunt serve,而不会出现错误。 I noticed that this modified my system path, so I agree that this is probably a path-related issue. 我注意到这修改了我的系统路径,因此我同意这可能是与路径有关的问题。

I had the same problem running browserSync on Windows 7 64-bit. 我在Windows 7 64位上运行browserSync时遇到了同样的问题。

Just in case if anyone stumbles across the same problem, I had to add %SystemRoot%\\system32 to PATH environment variable and it solved the issue. 万一有人偶然发现同一问题,我必须将%SystemRoot%\\system32添加到PATH环境变量中,这样就可以解决该问题。 %SystemRoot% usually resolves to C:\\Windows\\system32 (and it contains cmd.exe ). %SystemRoot%通常解析为C:\\Windows\\system32 (并且包含cmd.exe )。

I remembered this solution from one of the issues in GitHub browser-sync repo. 我记得GitHub浏览器同步存储库中的一个问题中的这种解决方案。 I will update the answer with the issue link, if I find it. 如果找到问题,我将使用问题链接更新答案。

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

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