Ionic serve -lab在更新脚本后出错

时间:2017-12-19 03:00:09

标签: ionic3

我更新脚本时遇到错误。这就是我的意思

首先正常运行Ionic serve -lab

这是结果,(工作正常)

$ ionic serve -lab
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser --lab - Ctrl+C to cancel
[09:56:49]  watch started ...
[09:56:49]  build dev started ...
[09:56:49]  clean started ...
[09:56:49]  clean finished in 8 ms
[09:56:49]  copy started ...
[09:56:49]  deeplinks started ...
[09:56:49]  deeplinks finished in 136 ms
[09:56:49]  transpile started ...
[09:56:56]  transpile finished in 6.74 s
[09:56:56]  preprocess started ...
[09:56:56]  preprocess finished in less than 1 ms
[09:56:56]  webpack started ...
[09:56:57]  copy finished in 7.53 s
[09:57:09]  webpack finished in 12.60 s
[09:57:09]  sass started ...
[09:57:11]  sass finished in 2.35 s
[09:57:11]  postprocess started ...
[09:57:11]  postprocess finished in 16 ms
[09:57:11]  lint started ...
[09:57:11]  build dev finished in 22.45 s
[09:57:11]  watch ready in 22.60 s
[09:57:11]  dev server running: http://localhost:8100/

[OK] Development server running!
     Local: http://localhost:8100
     External: http://192.168.3.223:8100
     DevApp: StoreMobile@8100 on DESKTOP-3OF111S

[09:57:17]  lint finished in 5.93 s

然后,我想稍微改变我的脚本(源代码)。我只是在我的HTML中随机添加一个字符串然后我得到一个错误。这是错误

[OK] Development server running!
     Local: http://localhost:8100
     External: http://192.168.3.223:8100
     DevApp: StoreMobile@8100 on DESKTOP-3OF111S

[09:57:17]  lint finished in 5.93 s
[09:59:09]  build started ...
[09:59:09]  deeplinks update started ...
[09:59:09]  deeplinks update finished in 19 ms
[09:59:09]  template update started ...
[09:59:09]  template update finished in 32 ms
[09:59:09]  build finished in 55 ms

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1020:11)
    at TCP.onread (net.js:568:26)

好吧,我可以再次运行ionic serve -lab,但是我可以lazy来运行它。那么,我该如何解决这个问题呢?对不起我的英文。

2 个答案:

答案 0 :(得分:1)

刚刚看到github上的解决方案问题似乎是由Chrome更新造成的。

以下解决方案似乎有效

  • 使用谷歌浏览器,例如ionic serve -w firefox
  • 设置此特定版本的ws npm install ws@3.3.2 --save-dev --save-exact
  • ionic/app-scripts更新为@3.1.6 ("为我工作")

答案 1 :(得分:0)

同样在这里:(

[17:15:53]  lint finished in 9.50 s 
[17:16:39]  build started ... 
[17:16:39]  deeplinks update started ... 
[17:16:39]  deeplinks update finished in 134 ms 
[17:16:39]  template update started ... 
[17:16:39]  template update finished in 6 ms 
[17:16:39]  build finished in 160 ms 

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1020:11)
    at TCP.onread (net.js:568:26)

EDIT&解: 搜索一下我发现这个https://forum.ionicframework.com/t/ionic-serve-crash-on-save/115615/22并且只使用safari而不是chrome就没有问题了。