Gruntjs grunt serve打开一个页面,其中包含;发生了通信错误";

Gruntjs grunt serve打开一个页面,其中包含;发生了通信错误";,gruntjs,yeoman,grunt-connect,Gruntjs,Yeoman,Grunt Connect,当我启动grunt serve命令时,会打开一个页面并写入一条消息: 发生通信错误:“” 我必须键入我的ip地址:9000才能查看我的应用程序,因为localhost:9000不工作 谢谢你的帮助。我不确定,但是你能验证一下在Grunfile.js中,第69-72行是否有这个: port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost',

当我启动grunt serve命令时,会打开一个页面并写入一条消息: 发生通信错误:“”

我必须键入我的ip地址:9000才能查看我的应用程序,因为localhost:9000不工作


谢谢你的帮助。

我不确定,但是你能验证一下在
Grunfile.js
中,第69-72行是否有这个:

    port: 9000,
    // Change this to '0.0.0.0' to access the server from outside.
    hostname: 'localhost',
    livereload: 35729
如果在本地服务器上运行服务器,则主机名中必须包含“localhost”


希望能有所帮助。

事实上,这是因为我的浏览器有缓存