前言:

在进行Vue3源码学习的时候,安装对应项目依赖时,出现的一个安装依赖问题
由于Vue3使用的是yarn
于是使用

yarn install

进行依赖安装,于是报下述错误
在这里插入图片描述

error F:\WUYUXIN\Vue3\Vue3-code\vue-next-3.0.11\node_modules\puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: F:\WUYUXIN\Vue3\Vue3-code\vue-next-3.0.11\node_modules\puppeteer
Output:
ERROR: Failed to download Chromium r722234! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: connect ECONNREFUSED 127.0.0.1:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16)
  -- ASYNC --
    at BrowserFetcher.<anonymous> (F:\WUYUXIN\Vue3\Vue3-code\vue-next-3.0.11\node_modules\puppeteer\lib\helper.js:111:15)
    at Object.<anonymous> (F:\WUYUXIN\Vue3\Vue3-code\vue-next-3.0.11\node_modules\puppeteer\install.js:66:16)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -4078,
  code: 'ECONNREFUSED',
  port: 443

解决方案

精简一下错误:

ERROR: Failed to download Chromium r722234! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: connect ECONNREFUSED 127.0.0.1:443

翻译过来也就是下载依赖出错。。。无法连接到依赖下载地址
解决方案就是设置为淘宝镜像

//设置淘宝镜像下载
npm config set puppeteer_download_host=https://npm.taobao.org/mirrors

yarn install

给我整无语了

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐