【问题标题】:grunt serve opens a page that indcates "a communication error occured"grunt serve 打开一个页面,显示“发生通信错误”
【发布时间】:2014-09-12 15:36:43
【问题描述】:

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

我必须输入我的 ip-address:9000 才能看到我的应用程序,因为 localhost:9000 不起作用。

感谢您的帮助。

【问题讨论】:

  • 其实是因为我的浏览器缓存

标签: gruntjs yeoman grunt-connect


【解决方案1】:

我不确定,但您能否验证Grunfile.js 中的第 69 - 72 行是否有此内容:

    port: 9000,
    // Change this to '0.0.0.0' to access the server from outside.
    hostname: 'localhost',
    livereload: 35729

如果您在本地运行服务器,则主机名中必须包含“localhost”。

希望它会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-23
    • 2013-02-25
    • 2020-03-22
    • 2014-04-03
    • 1970-01-01
    • 1970-01-01
    • 2011-01-25
    • 2017-03-21
    相关资源
    最近更新 更多