-
Notifications
You must be signed in to change notification settings - Fork 39
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 fails to run npm postinstall #68
Comments
I also found that running npm install cypress --foreground-scripts is successful, so it is something connected to running an npm lifecycle script in the background using node/npm from snap on Ubuntu. |
This issue only affects npm installed via snap node. Using Yarn installed via snap node works correctly. The following sequence completes successfully: yarn init -y
yarn add cypress -D
yarn cypress cache list |
Also reproducible installing using npm with: Ubuntu |
Will somebody be able to give some feedback on this issue? It may need a warning in the Cypress documentation, but I'd like to understand the root cause first before proposing a documentation update. snap is one of the recommended node package managers on https://nodejs.org/en/download/package-manager/all |
Sorry, I don't have clear advice for you on this one, snaps have trouble doing child process execs because they are already executed in constrained environments; I opt to not use node from a snap if I want to not bump into these problems. I wish I could get to the bottom of it and be able to either provide advice or fix something, but it's not obvious to me where to start digging and I don't have the time or reason to dig deeper, sorry. |
Thanks for your valuable feedback and my apologies for pinging you! I'm going to assume that the problem is inherent to snap and I'll propose a documentation update to Cypress. I don't personally use snap as a package manager for node (I prefer |
Issue
Attempting to install the npm module cypress fails at the postinstall stage using npm.
This issue does not occur if Node.js is not installed via snap, for instance via
nvm
.Steps to reproduce
On Ubuntu:
mkdir cy-test cd cy-test git init npm init -y npm install cypress -D
Note: If Cypress has been previously fully installed, then you need to execute the following to delete the Cypress binary from its cache:
or
rm -rf ~/.cache/Cypress
Environment
Ubuntu
22.04.4
LTSNode.js
v20.14.0 8723 20/stable
installed with snapContinues to be reproducible with
node 20.15.1 8864 20/stable
(bundled npm version10.7.0
)Logs
Install
snap
Workaround
Workaround - split postinstall phase
npx cypress install
is the equivalent ofnode ./node_modules/cypress/index.js --exec install
Workaround - install Node.js with nvm
Install Node.js on Ubuntu with nvm according to instructions on https://nodejs.org/en/download/package-manager
The text was updated successfully, but these errors were encountered: