Cypress trying to write to /root
See original GitHub issueCurrent behavior:
Cypress is failing when building in Jenkins with the latest 4.12.1, as it’s trying to write to /root/.cache/Cypress
in it’s postinstall script:
> cypress@4.12.1 postinstall /home/jenkins/agent/workspace/iris/web/client-ui/build/js/node_modules/cypress
> node index.js --exec install
Cypress cannot write to the cache directory due to file permissions
See discussion and possible solutions at
https://github.com/cypress-io/cypress/issues/1281
----------
Failed to access /root/.cache/Cypress:
EACCES: permission denied, mkdir '/root/.cache/Cypress'
According to the link, this issue should have been fixed in a previous version, but looks like it’s back. Reverting to my previous version (4.3.0) fixed the issue.
Desired behavior:
Cypress should not try to write to root, and if can’t, it should warn and work without caching. Or there should be an option to configure the cache, or it shouldn’t run automatically in the postinstall script.
Test code to reproduce
Run npm install
for a package using Cypress from a user that doesn’t have root access.
Versions
Platform: linux (CentOS - 7.7.1908) Cypress Version: 4.12.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Getting error "EACCES: permission denied" when i install ...
In my case cypress had trouble accessing /root/.cache/Cypress upon npm install : EACCES: permission denied, mkdir '/root/.cache/Cypress'.
Read more >cypress-io/cypress - Gitter
Make sure you have the latest version of node.js and npm installed. npm ERR! ... What is your output if you execute this...
Read more >Challenges in install Cypress in Ubuntu
First attempt to install Cypress globally yielded the following errors : Cypress cannot write to the cache directory due to file permissions ...
Read more >Installing Cypress
This will install Cypress locally as a dev dependency for your project. Make sure that you have already run npm init or have...
Read more >Changelog
Fixed an issue with Angular Component Testing where a custom sourceRoot configuration ... Cypress has always recommended writing tests in a clean context....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
can you elaborate and provide steps you followed?
@jennifer-shehane I see the comment on #7640 about setting correct permissions - what are the correct permissions to set? And why is there a different in behaviour between 4.3.0 and 4.12.1? I wasn’t getting this error on install with 4.3.0 previously, and I don’t see anything in the changelogs related to updating permissions because of migrating to a new version.