安装react-devtools时npm install失败解决方法

网上的所有教程基本都是把v3zip下载下来后淘宝镜像安装依赖:

npm --registry https://registry.npm.taobao.org install

但按照这种方法会出现如下报错

npm ERR! code 1
npm ERR! path D:\reactDevtool\react-devtools-3\node_modules\electron
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node install.js
Downloading electron-v1.8.7-win32-x64.zip
npm ERR! Error: read ECONNRESET
npm ERR! D:\reactDevtool\react-devtools-3\node_modules\electron\install.js:47
npm ERR!   throw err
npm ERR!   ^
npm ERR!
npm ERR! Error: read ECONNRESET
npm ERR!     at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20) {
npm ERR!   errno: -4077,
npm ERR!   code: 'ECONNRESET',
npm ERR!   syscall: 'read'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\XJW\AppData\Local\npm-cache\_logs\2022-02-05T08_40_12_048Z-debug.log

解决方案:使用cnpm

cnpm install

很奇怪为什么用淘宝源会不行,在实习单位和家中的电脑都遇到了这个问题,网上却没人说过这个问题并且都统一使用npm --registry https://registry.npm.taobao.org install

之后就跟教程一样了,npm run build:extension:chrome后加载解压后的扩展程序即可

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值