Cypress: Error: spawn EACCES when running cypress 3.0.1

Created on 6 Jun 2018  Â·  10Comments  Â·  Source: cypress-io/cypress

Seems to be fine with 3.0.0, but 3.0.1 fails

Current behavior:

Run:

npm install --save-dev cypress
./node_modules/.bin/cypress verify

Output:

It looks like this is your first time using Cypress: 3.0.1

✖ Verifying Cypress can run /Users/bdrew/Library/Caches/Cypress/3.0.1/Cypress.app
→ spawn EACCES
An unexpected error occurred while verifying the Cypress executable.

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

Error: spawn EACCES
at exports._errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:325:11)
at Object.exports.spawn (child_process.js:493:9)
at /Users/bdrew/code/pg-cypress/node_modules/cypress/lib/tasks/verify.js:67:22
at Promise._execute (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:79:10)
at spawn (/Users/bdrew/code/pg-cypress/node_modules/cypress/lib/tasks/verify.js:62:12)
at runSmokeTest (/Users/bdrew/code/pg-cypress/node_modules/cypress/lib/tasks/verify.js:109:12)
at /Users/bdrew/code/pg-cypress/node_modules/cypress/lib/tasks/verify.js:132:29
at tryCatcher (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:693:18)

at Promise._fulfill (/Users/bdrew/code/pg-cypress/node_modules/bluebird/js/release/promise.js:638:18)

Platform: darwin (17.6.0)
Cypress Version: 3.0.1

Desired behavior:

Cypress runs successfully

Steps to reproduce:

npm install --save-dev cypress
./node_modules/.bin/cypress verify

Versions

Cypress 3.0.1. does not affect 3.0.0

Most helpful comment

@drewbrend great, new command coming soon: cypress cache clear

All 10 comments

Hmm I'm going to guess you've done something funky with node or npm like install it/them with sudo. What version of node are you running and how did you install it?

This message simply means you don't have user permissions to access the executable that npm installed.

node is v8.2.1, I can't say for sure how it was installed as this is a company provided dev machine that came with it pre-installed. I wouldn't think it was installed with sudo though, I don't have to run npm commands with sudo.

@drewbrend can show what is printed by

ls -lha /Users/bdrew/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress

?
This will tell you if root installed the binary

There is a permission difference. What is interesting is I installed both 3.0.0 and 3.0.1 from the same terminal window, using the same npm command - and never with sudo.

ls -lha /Users/bdrew/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress

-rw------- 1 bdrew 1362576454 18K May 31 02:40 /Users/bdrew/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress

ls -lha /Users/bdrew/Library/Caches/Cypress/3.0.0/Cypress.app/Contents/MacOS/Cypress

-rwxr-xr-x 1 bdrew 1362576454 18K May 29 22:41 /Users/bdrew/Library/Caches/Cypress/3.0.0/Cypress.app/Contents/MacOS/Cypress

@drewbrend can you try rm -rf /Users/bdrew/Library/Caches/Cypress/3.0.0 and rerunning npm install [email protected] one more time...wondering if permissions get borked on subsequent installs to cache.
And maybe sudo rm -rf /Users/bdrew/Library/Caches/Cypress and reinstalling might fix the issue

I ran the commands you provided, and am still seeing the same permissions for 3.0.0.

I then ran those commands to remove 3.0.1 and reinstall it, and now it has the same permissions as 3.0.0.

It can now be verified and ran successfully. I'm not sure why it installed with the incorrect permissions in the first place, but it seems like an easy workaround is to remove it and reinstall.

Thanks!

@drewbrend great, new command coming soon: cypress cache clear

I am facing the same issue in Jenkins with version 3.1.5 as well as in 3.2.0. I tried reinstalling as well as running cypress cache clear. This is the error I get:

/node_modules/.bin/cypress verify
It looks like this is your first time using Cypress: 3.1.5

[?25l[11:43:21] Verifying Cypress can run /home/jenkins/.cache/Cypress/3.1.5/Cypress [started]
[?25hevents.js:167
throw er; // Unhandled 'error' event
^

Error: spawn Xvfb EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:231:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

Kindly help me with a solution to fix this issue..
I tried doing a cypress cache clear...setting permissions chmod -R u+x to next-tick and to electron-chromium as well as for /node_modules/.bin/cypress

@HTWTest This error is not related to this existing issue. The error is different, specifying EACCES during in Xvfb. Please open a new issue in the future.

You may try sudo apt-get install xvfb

How are you installing cypress? We have docker images available as well that may help: https://github.com/cypress-io/cypress-docker-images

@jennifer-shehane : Thank you. I have opened the issue that you have referenced. https://github.com/cypress-io/cypress/issues/4020 (HTWTest is my account. Sorry for the confusion).

Was this page helpful?
0 / 5 - 0 ratings