yarn版本过低导致的报错
今天在用yarn启动项目的时候报了这样的一个错。
warning Error running install script for optional dependency: "C:\frontApp\minibot-net\Src\Fcp\FcpAdminWebApp\node_modules\puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: C:\frontApp\minibot-net\Src\Fcp\FcpAdminWebApp\node_modules\puppeteer
Output:
ERROR: Failed to download Chromium r722234! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: getaddrinfo ENOTFOUND storage.googleapis.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
-- ASYNC --
at BrowserFetcher.<anonymous> (C:\frontApp\minibot-net\Src\Fcp\FcpAdminWebApp\node_modules\puppeteer\lib\helper.js:111:15)
at Object.<anonymous> (C:\frontApp\minibot-net\Src\Fcp\FcpAdminWebApp\node_modules\puppeteer\install.js:66:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
errno: -3008,
code: ENOTFOUND,
warning Your current version of Yarn is out of date. The latest version is "1.22.17", while youre on "1.22.10".
看到最后一行提示可以得出,是yarn版本过低导致的。那就试着更新下yarn.
npm install --global yarn
这样就执行成功了: