-
Notifications
You must be signed in to change notification settings - Fork 746
希望添加 chromium 镜像源 #1246
Comments
+1 |
已经配置了一个代理,请使用 https://storage.googleapis.com.cnpmjs.org PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org npm i puppeteer |
cnpm i puppeteer 现在也会去代理自动下载了。 |
https://storage.googleapis.com.cnpmjs.org 挂了?
|
【已修复】cnpm/mirrors#170 现在用cnpm 安装puppeteer用的是cdn.npm.taobao.org这个镜像,但是里面的文件没有及时更新,安装脚本下载的chromium版本是根据puppeteer项目中package.json里定义的版本号下载的,这个版本号经常更新到最新版,然后安装的时候就报404了 比如这个就不存在:https://cdn.npm.taobao.org/dist/chromium-browser-snapshots/Win_x64/526987/chrome-win32.zip C:\Users\user>cnpm i -g puppeteer
Downloading puppeteer to D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer_tmp
Copying D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer_tmp\_puppeteer@1.0.0@puppeteer to D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer
Installing puppeteer's dependencies to D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer/node_modules
[1/8] proxy-from-env@^1.0.0 installed at node_modules\_proxy-from-env@1.0.0@proxy-from-env
[2/8] progress@^2.0.0 installed at node_modules\_progress@2.0.0@progress
[3/8] mime@^1.3.4 installed at node_modules\_mime@1.6.0@mime
[4/8] debug@^2.6.8 installed at node_modules\_debug@2.6.9@debug
[5/8] ws@^3.0.0 installed at node_modules\_ws@3.3.3@ws
[6/8] https-proxy-agent@^2.1.0 installed at node_modules\_https-proxy-agent@2.1.1@https-proxy-agent
[7/8] extract-zip@^1.6.5 installed at node_modules\_extract-zip@1.6.6@extract-zip
[8/8] rimraf@^2.6.1 installed at node_modules\_rimraf@2.6.2@rimraf
execute post install 1 scripts...
[1/1] scripts.install puppeteer@1.0.0 run "node install.js"
ERROR: Failed to download Chromium r526987! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: Download failed: server returned code 404. URL: https://cdn.npm.taobao.org/dist/chromium-browser-snapshots/Win_x64/526987/chrome-win32.zip
at response (D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer\lib\Downloader.js:228:21)
at ClientRequest.require.request.res (D:\Users\user\AppData\Roaming\npm\node_modules\puppeteer\lib\Downloader.js:279:7)
at Object.onceWrapper (events.js:254:19)
at ClientRequest.emit (events.js:159:13)
at HTTPParser.parserOnIncomingClient (_http_client.js:550:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:117:23)
at TLSSocket.socketOnData (_http_client.js:439:20)
at TLSSocket.emit (events.js:159:13)
at addChunk (_stream_readable.js:265:12)
at readableAddChunk (_stream_readable.js:252:11)
Install fail! Error: post install error, please remove node_modules before retry!
Run "C:\Windows\system32\cmd.exe /d /s /c node install.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "C:\Windows\system32\cmd.exe /d /s /c node install.js" error, exit code 1
at ChildProcess.proc.on.code (D:\Users\user\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:74:21)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
npminstall version: 3.2.1
npminstall args: D:\Program Files\nodejs\node.exe D:\Users\user\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --china --userconfig=C:\Users\user\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=http://registry.npm.taobao.org -g puppeteer |
安装依旧失败 |
@SAOSO 可以设置环境变量然后用npm安装 PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org
npm i puppeteer |
如果使用 npm config set puppeteer_download_host=https://storage.googleapis.com.cnpmjs.org |
@fwh1990 This works for me, under Windows 10 cmd. |
现在要用 https://npm.taobao.org/mirrors 这个地址 |
还是这种方式适用性更好 |
这么设置,亲测可用
|
@Nicholasnc 你应该是写错了。 |
换了源之后,yarn安装就可以了 |
|
已经流水线执行过,可行,非常优秀。 |
请使用新的域名 npm config set puppeteer_download_host=https://npmmirror.com/mirrors/ |
对不起,这不是一条 issue,但实在找不到提交建议的渠道。
新版本的 puppeteer 将支持通过配置环境变量 PUPPETEER_DOWNLOAD_HOST 来定义下载源,目前官方源在大陆实在十分令人感到抓狂。
希望采纳,十分感谢。
The text was updated successfully, but these errors were encountered: