网上的所有教程基本都是把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后加载解压后的扩展程序即可