简体   繁体   English

angularjs - Grunt serve给出“spawn cmd ENOENT”错误

[英]angularjs - Grunt serve gives “spawn cmd ENOENT” error

I'm pretty new to using Grunt and I'm getting this error and I've tried everything anyone has suggested in related posts. 我很擅长使用Grunt,我收到了这个错误,我已经尝试过任何人在相关帖子中提出的建议。

connect: {
        options: {
            port: 9000,
            // Change this to '0.0.0.0' to access the server from outside.
            hostname: 'localhost',
            livereload: 35729
        },
        livereload: {
            options: {
                open: true,
                middleware: function (connect) {
                    return [
                        connect.static('.tmp'),
                        connect().use(
                            '/bower_components',
                            connect.static('./bower_components')
                        ),
                        connect().use(
                            '/app/styles',
                            connect.static('./app/styles')
                        ),
                        connect.static(appConfig.app)
                    ];
                }
            }
        },

Here is my config 这是我的配置

And when I run grunt serve I get the error 当我运行grunt服务时,我得到了错误

Running "connect:livereload" (connect) task
Started connect web server on http://localhost:9000
Fatal error: spawn cmd ENOENT

I have windows\\system32\\ in my environmental variables and I've looked over my config files and can't make heads or tails of it. 我的环境变量中有windows \\ system32 \\,我查看了我的配置文件,无法做出正面或反面。 I've additionally run npm cache clean as checking it's installed. 我另外运行npm cache clean作为检查它的安装。

C:\Users\Thomas Wollschlager\Documents\webapp>npm -v
3.8.3

Any help or suggestions would be greatly appreciated. 任何帮助或建议将不胜感激。 Thanks guys! 多谢你们!

` `

Run it using command prompt instead of gitBash. 使用命令提示符而不是gitBash运行它。 Worked for me 为我工作

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

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