question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress trying to write to /root

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
JUPUDI-VAMSI-KALYANcommented, May 9, 2022

can you elaborate and provide steps you followed?

3reactions
mofojedcommented, Aug 17, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found