【问题标题】:'grunt serve' starts fine but never loads'grunt serve' 开始正常但从不加载
【发布时间】:2015-02-24 05:24:52
【问题描述】:

我刚刚在 Windows 上使用 JHipster 创建了一个新应用程序。我可以使用“mvn spring-boot:run”很好地运行它。但是,我想自动重新加载页面,因此想使用“grunt serve”。当我运行它时,它开始正常。但是当我在 Chrome 中转到“http://localhost:3000/”时,它只是坐在那里等待服务器连接。我可以去http://localhost:3001/ 看看BrowserSync 但“当前连接”部分下没有列出任何服务器。

这是我在运行“grunt serve”后看到的输出:

C:\mydev\pmi>grunt serve
Running "clean:server" (clean) task
>> 0 paths cleaned.

Running "wiredep:app" (wiredep) task

Running "wiredep:test" (wiredep) task

Running "ngconstant:dev" (ngconstant) task
Creating module pmiApp at src/main/webapp/scripts/app/app.constants.js...OK

Running "concurrent:server" (concurrent) task

Running "browserSync:dev" (browserSync) task
[BS] [info] Proxying: http://localhost:8080
[BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://10.255.247.72:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://10.255.247.72:3001
 --------------------------------------
[BS] Watching files...

Running "watch" task
Waiting...

我只是在浏览器中看不到任何东西(Chrome 和 Firefox 都没有连接)。

我看到另一个帖子建议我删除我的节点模块目录并使用“npm install”重新安装。我这样做了,得到了同样的结果。

今晚我已经看了一个半小时了。昨晚,终于触发了一些东西,它开始工作了。但是今晚我遇到了同样的问题。我不知道昨晚终于让它工作了。昨晚我一直有同样的问题一个小时。

我被难住了。

【问题讨论】:

  • 我有同样的错误,知道吗?

标签: gruntjs jhipster browser-sync


【解决方案1】:

你不是唯一一个:)。我也遇到了这个问题。

只是为了澄清。你需要同时运行这两个

'mvn spring-boot:run'

'咕噜咕噜'

【讨论】:

    【解决方案2】:

    天啊

    我错误地认为“grunt serve”与“mvn spring-boot:run”做了同样的事情(只是更好)。不是这样。

    "mvn spring-boot:run" 运行后端 Web 服务器并处理 REST 端点。

    'grunt serve' 处理前端 angularJS 方面的事情。

    现在回顾文档很明显。

    真是个菜鸟。

    【讨论】:

      【解决方案3】:

      如果你使用 gradle,你可以运行这个:

      ./gradlew bootRun
      

      在我的例子中,下面的消息通知您可以访问 spring 应用程序: > 构建 85% > :bootRun

      之后你可以运行这个:

      grunt serve
      

      消息“正在运行“watch”任务等待...”将出现在控制台中,但是 浏览器会自动打开并显示如下地址:

      http://localhost:3000/#/
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-05
        • 1970-01-01
        • 2015-05-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多