当前位置:   article > 正文

npm--解决npm install时github的read ECONNRESET问题_npm login 报错 read econnreset

npm login 报错 read econnreset

原文网址:npm--解决npm install时github的read ECONNRESET问题_IT利刃出鞘的博客-CSDN博客

简介

        本文介绍解决npm install时github的read ECONNRESET问题。

问题复现

在下载node-sass时,报错了。

命令是:

npm install -D node-sass@6.0.1

报错信息:

  1. > node scripts/install.js
  2. Downloading binary from https://github.com/sass/node-sass/releases/download/v6.0.1/win32-x64-83_binding.node
  3. Cannot download "https://github.com/sass/node-sass/releases/download/v6.0.1/win32-x64-83_binding.node":
  4. read ECONNRESET
  5. Hint: If github.com is not accessible in your location
  6. try setting a proxy via HTTP_PROXY, e.g.
  7. export HTTP_PROXY=http://example.com:1234
  8. or configure npm proxy via
  9. npm config set proxy http://example.com:8080
  10. > node-sass@6.0.1 postinstall E:\work\WebStorm_proj\demo_FrontEnd\demo_vue_scss\node_modules\node-sass
  11. > node scripts/build.js
  12. 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

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/174592
推荐阅读
相关标签
  

闽ICP备14008679号