Skip to content
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

CYPRESS_INSTALL_BINARY on Windows Concats to Download URL #4296

Closed
fhilton opened this issue May 23, 2019 · 20 comments
Closed

CYPRESS_INSTALL_BINARY on Windows Concats to Download URL #4296

fhilton opened this issue May 23, 2019 · 20 comments
Labels
OS: windows topic: installation Issue during installation or downloading Cypress

Comments

@fhilton
Copy link

fhilton commented May 23, 2019

Current behavior:

On windows 10, setting CYPRESS_INSTALL_BINARY with the following:

setx CYPRESS_INSTALL_BINARY C:/cypressBinary.3.3.1/cypress.zip /M

Then run npm install

npm install cypress@3.3.1

Produces this in the install log:

‼ Warning: Forcing a binary version different than the default.

The CLI expected to install version: 3.3.1

Instead we will install version: C:/cypressBinary.3.3.1/cypress.zip

These versions may not work properly together.

Installing Cypress (version: C:/cypressBinary.3.3.1/cypress.zip)

× Downloading Cypress
→ Cypress Version: 3.3.1
Unzipping Cypress
Finishing Installation
The Cypress App could not be downloaded.

Please check network connectivity and try again:


URL: https://download.cypress.io/desktop/C:/cypressBinary.3.3.1/cypress.zip?platform=win32&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found

Notice how the URL contains the path to the zip file.

Some more details here: cypress-io/cypress-documentation#761 (comment)

and a proposed solution here: cypress-io/cypress-documentation#761 (comment)

Desired behavior:

Setting CYPRESS_INSTALL_BINARY on windows should install using the file located in the env variable.

Steps to reproduce: (app code and test code)

  • Download the cypress zip file to C:/cypressBinary.3.3.1/cypress.zip
  • Run setx CYPRESS_INSTALL_BINARY C:/cypressBinary.3.3.1/cypress.zip /M
  • Reload command window to refresh env variable
  • Run npm install cypress@3.3.1
@jasmine-zhang-nz
Copy link

jasmine-zhang-nz commented May 24, 2019

I have a similar issue, after set up the http_proxy and https_proxy, I still not able to install Cypress 3.3.1

The error message is: The Cypress App could not be downloaded. Please check network connectivity and try again.

I have already setup the proxy, so if 3.3.1 has resolved the issue, this should not happen again.

@jennifer-shehane
Copy link
Member

@jasmine-zhang-nz Are you also setting the CYPRESS_INSTALL_BINARY? If not, I believe you are having a separate issue and should open a new issue.

@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label May 24, 2019
@tomasbjerre
Copy link
Contributor

Could it be that the file does not exist? That should be made clerar with the fix in #5060

@ari-meetai
Copy link

Used "" instead of "/" and it worked.

i.e.: "c:\cypressBinary\cypress.zip"

@kaiyoma
Copy link

kaiyoma commented Apr 10, 2020

I've run into this problem as well. If I set CYPRESS_INSTALL_BINARY in the Cygwin/Unix style (e.g. /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip) I see this in the output of yarn install:

Exit code: 1
Command: node index.js --exec install
Arguments:
Output:
‼ Warning: Forcing a binary version different than the default.
  The CLI expected to install version: 4.1.0
  Instead we will install version: /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip
  These versions may not work properly together.
Installing Cypress (version: /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip)
[16:48:05]  Downloading Cypress     [started]
[16:48:07]  Downloading Cypress     [failed]
[16:48:07] → 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 environm
ent variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
----------
URL: https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?pl
atform=win32&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found

You can see that the URL is very badly malformed:

https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64

But I believe it's a problem that the URL is being created anyway. Why is Cypress trying to download a binary when I already told it I have one locally?

@jennifer-shehane
Copy link
Member

Could you run cypress install in debug mode mode and print the entire set of logs here?

There should be a debug log that will print the CYPRESS_INSTALL_BINARY we are reading in, perhaps this will highlight some problem.

@kaiyoma
Copy link

kaiyoma commented Apr 17, 2020

$ CYPRESS_INSTALL_BINARY=~/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip DEBUG=cypress:* yarn cypress install
yarn run v1.22.4
$ "C:\Users\Kyle Getz\Work\event-viewer\node_modules\.bin\cypress" install
  cypress:cli:cli cli starts with arguments ["C:\\Program Files\\Node.js\\node.exe","C:\\Users\\Kyle Getz\\Work\\event-viewer\\node_modules\\cypress\\bin\\cypress","install"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +4ms
  cypress:cli parsed cli options {} +495ms
  cypress:cli installing with options {} +0ms
  cypress:cli version in package.json is 4.1.0 +1ms
  cypress:cli Using CYPRESS_INSTALL_BINARY from environment variable +5ms
  cypress:cli Using CYPRESS_INSTALL_BINARY from environment variable +1ms
  cypress:cli using environment variable CYPRESS_INSTALL_BINARY "/c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip" +1ms
  cypress:cli Reading binary package.json from: C:\Users\Kyle Getz\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\package.json +0ms
  cypress:cli no binary installed under cli version +14ms
‼ Warning: Forcing a binary version different than the default.

  The CLI expected to install version: 4.1.0

  Instead we will install version: /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip

  These versions may not work properly together.

  cypress:cli checking local file /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip cwd C:\Users\Kyle Getz\Work\event-viewer +4ms
  cypress:cli preparing to download and unzip version  /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip to path C:\Users\Kyle Getz\AppData\Local\Cypress\Cache\4.1.
0 +26ms
Installing Cypress (version: /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip)

  cypress:cli needed Cypress version: /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip +0ms
  cypress:cli source url https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64 +1ms
  cypress:cli downloading cypress.zip to "C:\Users\KYLEGE~1\AppData\Local\Temp\cypress.zip" +4ms
  cypress:cli Downloading package {
  url: 'https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64',
  proxy: null,
  downloadDestination: 'C:\\Users\\KYLEGE~1\\AppData\\Local\\Temp\\cypress.zip'
} +24ms
  /  Downloading Cypress
     Unzipping Cypress
     Finishing Installation
  cypress:cli response code 404 +351ms
  cypress:cli URL: https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64
  ×  Downloading Cypress
    → Cypress Version: 4.1.0
     Unzipping Cypress
     Finishing Installation
  cypress:cli downloading finished +8ms
  cypress:cli downloaded file lacks checksum or size to verify +0ms
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.cypres
s.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found

----------

Platform: win32 (10.0.18363)
Cypress Version: 4.1.0

@kaiyoma
Copy link

kaiyoma commented Apr 17, 2020

Just ran into a related issue. I have version 4.1.0 specified in my package.json, but when I yarn install, Cypress downloads the wrong version, then complains that the checksum doesn't match:

yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info fsevents@1.2.11: The platform "win32" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/11] ⠄ waiting...
[-/11] ⡀ waiting...
[-/11] ⡀ waiting...
[4/11] ⡀ cypress
error C:\Users\Kyle Getz\Work\event-viewer\node_modules\@types\testing-library__cypress\node_modules\cypress: Command fa
iled.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: C:\Users\Kyle Getz\Work\event-viewer\node_modules\@types\testing-library__cypress\node_modules\cypress
Output:
Installing Cypress (version: 4.2.0)

[09:10:44]  Downloading Cypress     [started]
[09:10:45]  Downloading Cypress      0% 0s [title changed]
[09:10:46]  Downloading Cypress      1% 80s [title changed]
[09:10:46]  Downloading Cypress      1% 90s [title changed]
[09:10:46]  Downloading Cypress      1% 100s [title changed]
...
[09:13:36]  Downloading Cypress      98% 4s [title changed]
[09:13:37]  Downloading Cypress      99% 2s [title changed]
[09:13:38]  Downloading Cypress      100% 0s [title changed]
[09:13:41]  Downloading Cypress      100% 0s [failed]
[09:13:41] → 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 environm
ent variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/4.2.0?platform=win32&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 45e16e4dd692ff89ddd8155bd80caaddbf11ba6ee12e57a3fbcbe12e5245418196840a324b9e0
22699b295f6364c0500c7df41baf0611f89f3316066b1c39c7e
Computed checksum: f17e5e344fbd17de1b7b9ec2d8756161f6f55ab36300e75b1b53107af8183fe1c77b7e95448590c26cdb48209663d07cb251e
3774e2d51381960043c41b6ad38

Expected downloaded file to have size: 168629214
Computed size: 168629214

----------

Platform: win32 (10.0.18363)
Cypress Version: 4.2.0
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 environm
ent variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/4.2.0?platform=win32&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 45e16e4dd692ff89ddd8155bd80caaddbf11ba6ee12e57a3fbcbe12e5245418196840a324b9e0
22699b295f6364c0500c7df41baf0611f89f3316066b1c39c7e
Computed checksum: f17e5e344fbd17de1b7b9ec2d8756161f6f55ab36300e75b1b53107af8183fe1c77b7e95448590c26cdb48209663d07cb251e
3774e2d51381960043c41b6ad38

Expected downloaded file to have size: 168629214
Computed size: 168629214

----------

No one told it to download version 4.2.0. Why is it doing that?

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@jennifer-shehane jennifer-shehane removed the stage: needs investigating Someone from Cypress needs to look at this label Aug 28, 2020
@kaiyoma
Copy link

kaiyoma commented Aug 28, 2020

This is still an issue.

@jennifer-shehane
Copy link
Member

@kaiyoma Could you run Cypress in debug mode mode and print the entire set of logs here?

@kaiyoma
Copy link

kaiyoma commented Oct 19, 2020

I believe I already did this here: #4296 (comment)

@jennifer-shehane jennifer-shehane added the topic: installation Issue during installation or downloading Cypress label Oct 29, 2020
@jennifer-shehane
Copy link
Member

@kaiyoma The checksum issue is a duplicate of #4595

@kaiyoma
Copy link

kaiyoma commented Jan 22, 2021

@jennifer-shehane I don't think this is the same issue. It's not an issue of the checksum being wrong. The actual URL is being constructed incorrectly and the download fails entirely. I still run into this issue, so please leave this open.

An example URL (from my post above) which is clearly wrong:

https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip?platform=win32&arch=x64

@kaiyoma
Copy link

kaiyoma commented Jan 28, 2021

@jennifer-shehane Can you please reopen this issue? Otherwise I'm just going to have to file a new one with all the same info again, because I still run into this issue regularly. Note the URL below:

----------

Platform: win32 (10.0.19042)
Cypress Version: 6.2.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 environm
ent variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop//c/Users/Kyle%20Getz/AppData/Local/Cypress/Cache/cypress-6.2.1-win32-x64.zip?pl
atform=win32&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found

----------

@bahmutov
Copy link
Contributor

@kaiyoma The suspicious log line in your DEBUG logs is this one

cypress:cli checking local file /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip cwd C:\Users\Kyle Getz\Work\event-viewer

For some reason, it see a mixture of unix-like paths and window current working directory. Because you said it was Cygwin - what happens when you pass the traditional Windows path to the binary? Because that would break the path.relative check under Nodejs.

@kaiyoma
Copy link

kaiyoma commented Jan 28, 2021

@kaiyoma The suspicious log line in your DEBUG logs is this one

cypress:cli checking local file /c/Users/Kyle Getz/AppData/Local/Cypress/Cache/cypress-4.1.0-win32-x64.zip cwd C:\Users\Kyle Getz\Work\event-viewer

For some reason, it see a mixture of unix-like paths and window current working directory. Because you said it was Cygwin - what happens when you pass the traditional Windows path to the binary? Because that would break the path.relative check under Nodejs.

I can try this out, but I will note that Cypress's own docs use the forward-slash, Unix style for directories, even for Windows:

https://docs.cypress.io/guides/getting-started/installing-cypress.html

@kaiyoma
Copy link

kaiyoma commented Jan 28, 2021

I can try this out, but I will note that Cypress's own docs use the forward-slash, Unix style for directories, even for Windows:

https://docs.cypress.io/guides/getting-started/installing-cypress.html

I believe using Windows-style paths does actually work here, thanks for the suggestion! I guess that means the docs are wrong?

(I also didn't realize that CYPRESS_INSTALL_BINARY can take a URL, which actually works better for me anyway, so I'll be switching to that notation.)

@bahmutov
Copy link
Contributor

In our examples we see Unix-style path, do you find it somewhere else?

Screen Shot 2021-01-28 at 6 31 09 PM

@kaiyoma
Copy link

kaiyoma commented Jan 29, 2021

I see Unix-style for Windows here:

image

And also here:

image

Also, that path in the first screenshot is wrong. It's missing a ~ in front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: windows topic: installation Issue during installation or downloading Cypress
Projects
None yet
Development

No branches or pull requests

7 participants