我正在尝试使用 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/