-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@fengmk2 是否可以考虑通过URL重写的方式兼容CYPRESS_DOWNLOAD_MIRROR
方案呢?
#267
Comments
一种折中的方案是cypress增加一级目录/desktop,即https://cdn.npmmirror.com/binaries/cypress/10.3.0/linux-x64/cypress.zip 改成 https://cdn.npmmirror.com/binaries/cypress/desktop/10.3.0/linux-x64/cypress.zip 这样就可以通过设置CYPRESS_DOWNLOAD_MIRROR和CYPRESS_DOWNLOAD_PATH_TEMPLATE来达到正确的下载地址 华为镜像源有做过这样的改动,但只有3.2.0一个版本https://repo.huaweicloud.com/cypress/desktop |
cnpm i cypress 我测试了一下可以正确安装,你是遇到了什么问题吗? |
yarn安装时下载慢的问题,不是cnpm问题。 |
是否可以支持 这个变量在官方文档提及: https://docs.cypress.io/guides/references/advanced-installation#Mirroring ❯ CYPRESS_DOWNLOAD_MIRROR="https://npmmirror.com/mirrors/cypress/" npm i -D cypress
(##################) ⠋ reify:rxjs: timing reifyNode:node_modules/cypress Completed in 604ms
> cypress@10.3.1 postinstall
> node index.js --exec install
Installing Cypress (version: 10.3.1)iming reifyNode:node_modules/cypress Completed in 604ms
✖ The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment v…
Otherwise, please check network connectivity and try again:
----------
URL: https://npmmirror.com/mirrors/cypress/desktop/10.3.1?platform=linux&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found
----------
Platform: linux-x64 (Manjaro Linux - 21.3.4)
Cypress Version: 10.3.1
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
----------
URL: https://npmmirror.com/mirrors/cypress/desktop/10.3.1?platform=linux&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found
----------
Platform: linux-x64 (Manjaro Linux - 21.3.4)
Cypress Version: 10.3.1
npm ERR! code 1
npm ERR! path /tmp/npm-test/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! A complete log of this run can be found in:
npm ERR! /home/fengyu/.npm/_logs/2022-07-20T02_08_44_002Z-debug-0.log |
我的理解,淘宝源是通过cnpm工具做了支持,你说的这个npm问题和yarn遇到的问题是一样的,npm和yarn要求指定的源要按照cypress的下载路径格式存放,npm和yarn本身没有对这个地址做转化的功能。 |
@cnmission @fengmk2 看了下cypress的源码: https://github.com/cypress-io/cypress/blob/36278fca013e24c17f8060dba4c0eaed5c2d396f/cli/lib/tasks/download.js#L78-L86 cypress还支持 ❯ CYPRESS_DOWNLOAD_MIRROR='https://npmmirror.com/mirrors/cypress/' CYPRESS_DOWNLOAD_PATH_TEMPLATE='${endpoint}/${platform}-${arch}/cypress.zip' npm i -D cypress
(##################) ⠦ reify:cypress: timing reifyNode:node_modules/lodash Completed in 652ms
> cypress@10.3.1 postinstall
> node index.js --exec install
Installing Cypress (version: 10.3.1)iming reifyNode:node_modules/cypress Completed in 666ms
✖ The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment v…
Otherwise, please check network connectivity and try again:
----------
URL: https://npmmirror.com/mirrors/cypress/desktop/10.3.1/linux-x64/cypress.zip
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found
----------
Platform: linux-x64 (Manjaro Linux - 21.3.4)
Cypress Version: 10.3.1
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
----------
URL: https://npmmirror.com/mirrors/cypress/desktop/10.3.1/linux-x64/cypress.zip
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found
----------
Platform: linux-x64 (Manjaro Linux - 21.3.4)
Cypress Version: 10.3.1
npm ERR! code 1
npm ERR! path /tmp/npm-test/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! A complete log of this run can be found in:
npm ERR! /home/fengyu/.npm/_logs/2022-07-20T02_34_33_713Z-debug-0.log 是否可以再增加一级目录 /desktop --> ./ 这样就可以解决cypress download binary的问题 |
或许cypress修改一下更好点 |
所以 |
见cnpm的配置文件用例: https://github.com/cnpm/binary-mirror-config/blob/master/package.json#L59 CYPRESS_DOWNLOAD_PATH_TEMPLATE=https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip 另外我给cypress提交了一个PR,可以支持通过 |
@fengmk2 是否可以考虑通过URL重写的方式兼容
CYPRESS_DOWNLOAD_MIRROR
方案呢?比如配置
CYPRESS_DOWNLOAD_MIRROR=https://npm.taobao.org/mirrors/cypress/
然后将类似于
https://npm.taobao.org/mirrors/cypress/desktop/4.5.0?platform=linux&arch=x64
这种规则重写为https://npm.taobao.org/mirrors/cypress/4.5.0/linux-x64/cypress.zip
?我看阿里云的CDN应该支持这种重写规则,无论如何,感谢镜像站的付出。
Originally posted by @abcfy2 in cnpm/mirrors#215 (comment)
The text was updated successfully, but these errors were encountered: