赞
踩
原文网址:npm--解决npm install时github的read ECONNRESET问题_IT利刃出鞘的博客-CSDN博客
本文介绍解决npm install时github的read ECONNRESET问题。
在下载node-sass时,报错了。
命令是:
npm install -D node-sass@6.0.1
报错信息:
- > node scripts/install.js
-
- Downloading binary from https://github.com/sass/node-sass/releases/download/v6.0.1/win32-x64-83_binding.node
- Cannot download "https://github.com/sass/node-sass/releases/download/v6.0.1/win32-x64-83_binding.node":
-
- read ECONNRESET
-
- Hint: If github.com is not accessible in your location
- try setting a proxy via HTTP_PROXY, e.g.
-
- export HTTP_PROXY=http://example.com:1234
-
- or configure npm proxy via
-
- npm config set proxy http://example.com:8080
-
- > node-sass@6.0.1 postinstall E:\work\WebStorm_proj\demo_FrontEnd\demo_vue_scss\node_modules\node-sass
- > node scripts/build.js
-
- Building: D:\dev\nodejs\node.exe E:\work\WebStorm_proj\demo_FrontEnd\demo_vue_scss\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
是连接到github失败导致的。
1. 设置registry
npm config set registry http://registry.npmmirror.com
2. 设置proxy
npm config set proxy=http://127.0.0.1:8087
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。