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

Improve error message when this binary file does not have executable permissions #8397

Closed
kpittman-securus opened this issue Aug 24, 2020 · 6 comments · Fixed by #8438
Closed

Comments

@kpittman-securus
Copy link

kpittman-securus commented Aug 24, 2020

Current behavior:

After npm install cypress@5.0.0 and npx cypress open I get:

Cypress cannot run because this binary file does not have executable permissions here:

/Users/me/Library/Caches/Cypress/5.0.0/Cypress.app/Contents/MacOS/Cypress

Reasons this may happen:

- node was installed as 'root' or with 'sudo'
- the cypress npm package as 'root' or with 'sudo'

Please check that you have the appropriate user permissions.

----------

Platform: darwin (19.6.0)
Cypress Version: 5.0.0

Desired behavior:

Cypress should open - works fine with version 4.12

Test code to reproduce

Cypress installed via NPM

Versions

Cypress: 5.0.0
OS: MacOS Catalina 10.15.16
Node: Tested on 12.18.2 and 14.8.0 using NVM

The same thing happens if I use ./node_modules/cypress/bin/cypress open instead of npx cypress. Both commands work if I revert back to Cypress 4.12.1

@jennifer-shehane
Copy link
Member

I can't see why anything involving the executable would have changed in 5.0.0.

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

But ultimately this seems to throw if the executable is not executable based off of running it through this npm module: https://github.com/kevva/executable#readme

So, I would suggest double checking the permissions on your node and cypress npm package.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Aug 25, 2020
@kpittman-securus
Copy link
Author

kpittman-securus commented Aug 25, 2020

@jennifer-shehane I resolved it by manually doing rm -rf /Users/me/Library/Caches/Cypress/ and it fixed itself after reinstalling. No idea why!

Possible enhancement would be to have an error/warning message that instructs user how to clear cache and reinstall. I didn't see a way to manually clear out the cache in the docs, just a way to set alternate cache dir.

Like, instead of just saying "there's something wrong with how you installed node" - tell user "try deleting the cache and reinstalling Cypress" or even maybe there could be a way to tell Cypress to install with a --skip-cache flag (not sure how that would work with npm). Then the error message could let the user know to try that step instead of creating a github issue (😅 ) , or going straight into modifying their installation of node.

@jennifer-shehane
Copy link
Member

You can clear cache by running cypress cache clear

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Aug 27, 2020
@kpittman-securus
Copy link
Author

kpittman-securus commented Aug 27, 2020

Yes - but only if you were to know you needed to :D I think that would be a great message to add in place of the "node was installed with sudo" etc

@jennifer-shehane jennifer-shehane changed the title Cypress 5.0.0 - this binary file does not have executable permissions Improve error message when this binary file does not have executable permissions Aug 28, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels Aug 28, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 11, 2020

The code for this is done in cypress-io/cypress#8438, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 15, 2020

Released in 5.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants