node.js - 如何修复 gyp-ERR ECONNRESET?

标签 node.js node-gyp

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

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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ee0e1eaeba3e9f7fecebda0b6a0be" rel="noreferrer noopener nofollow">[email protected]</a>
gyp info using <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aec0c1cacbee96809f9c809e" rel="noreferrer noopener nofollow">[email protected]</a> | 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-gyp 正在通过下载脚本来执行它们。互联网连接似乎不稳定,这就是脚本下载在中间停止的原因。有些文件非常大,需要下载,例如 SHASUMS256.txt。请尝试在稳定的互联网连接上运行该命令。

关于node.js - 如何修复 gyp-ERR ECONNRESET?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52535095/

相关文章:

c++ - 追踪器 : error TRK0005: Failed to locate: "CL.exe"

node.js - 无法在 Windows 7 x64/VS2012 上安装需要编译的 Node 模块

sqlite - NodeJS + AppJS + Sqlite3

javascript - 通过回调将值传递给父函数

javascript - 如何在 JavaScript 中设置函数执行顺序以使用回调函数?

node.js - 在 node.js 中管道流的性能是什么?

windows - 无需构建即可在 Windows 上获取 node-gyp 依赖模块

node.js - 在 macOS Bigsur 上出现 `npm install` 时出现 Node-gyp 错误

javascript - Nodes Express App.Route Path 混淆其他文件夹

node.js - 使实时 socket.io Pong 游戏更快