首页 > 解决方案 > 如何修复 gyp-ERR ECONNRESET?

问题描述

我正在尝试使用纱线构建一个角度项目,但我总是收到一些错误。

Build failed with error code: 1"
success Saved lockfile.
Done in 72.30s. 

实际上,发生此错误是因为 node-gyp 失败:

c:\temp\helloworld>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@8.12.0 | win32 | x64
gyp http GET https://nodejs.org/download/release/v8.12.0/node-v8.12.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v8.12.0/node-v8.12.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v8.12.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v8.12.0/win-x64/node.lib
gyp http GET https://nodejs.org/download/release/v8.12.0/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v8.12.0/SHASUMS256.txt
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack     at TLSWrap.onread (net.js:622:25)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\matyig\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd c:\temp\helloworld
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

c:\temp\helloworld>

任何想法?

标签: node.jsnode-gyp

解决方案


Node-gyp 通过下载脚本来执行脚本。似乎互联网连接不稳定,这就是脚本下载在两者之间停止的原因。有些文件非常大,需要像 SHASUMS256.txt 一样下载。请尝试在稳定的互联网连接上运行该命令。


推荐阅读