Error: read ECONNRESET occurs on ionic serve for newly created apps

Error: read ECONNRESET occurs on ionic serve for newly created apps

我刚刚创建了一个 ionic 3 应用程序。当我执行 ionic serve 时,它运行成功,但是当我更改项目中任何文件的某些内容时,例如更改文本 "Welcome to Ionic",serve 中断并抛出以下错误。

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

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

我的离子详细信息是

cli packages: (C:\Users\Imdad Turi\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.18.0
ionic (Ionic CLI) : 3.18.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.3
Node              : v6.9.1
npm               : 4.6.1
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Users\Public

Misc:

backend : pro

有人吗?

此错误是由使用 ws v3.3.3 作为依赖项的最新 ionic-app-script 包引起的。

对我有用的解决方案: 删除 ./node_modules/ws 文件夹和 运行

npm install ws@3.3.2

如果这不起作用,请尝试将 ionic/app-scripts 升级到版本 3.1.6。

https://github.com/ionic-team/ionic-app-scripts/issues/1345

这可以通过使用解决,我在 MAC dring IONIC 应用程序开发中遇到过这个问题 npm install ws@3.3.2 --save-dev --save-exact 这肯定会奏效:)

npm install @ionic/app-scripts@3.1.6 --save-dev