Cypress cannot write to the cache directory due to file permissions in Bitbucket pipeline
See original GitHub issueCurrent behavior
When running npm install
in bitbucket pipelines, this happens:
> cypress@6.4.0 postinstall /opt/atlassian/pipelines/agent/build/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'
----------
Desired behavior
Don’t write to the root directory. This should be fixed since 4.6.0, according to #1281
Test code to reproduce
Create a Bitbucket repository, enable pipelines, do npm i
in the Bitbucket pipeline.
Versions
6.4.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:9
Top Results From Across the Web
Troubleshooting
Open Cypress via cypress open · Go to Developer Tools -> View App Data · This will take you to the directory in...
Read more >Getting error "EACCES: permission denied" when i install ...
Cypress cannot write to the cache directory due to file permissions npm ERR! npm ERR! See discussion and possible solutions at npm ERR!...
Read more >cypress-io/cypress - Gitter
... --exec install Cypress cannot write to the cache directory due to file permissions ---------- Failed to access /Users/anilyadav/Library/Caches/Cypress: ...
Read more >Caches | Bitbucket Cloud
Bitbucket Pipelines is able to cache external build dependencies and directories between builds, to reduce consumed build minutes.
Read more >Caching Dependencies
Warning: Caching files between different executors, for example, between Docker and machine, Linux, Windows or macOS, or CircleCI image and non-CircleCI image, ...
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 Free
Top 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
I was getting same issue: # EACCES: permission denied, mkdir ‘/root/.cache/Cypress’
I’ve fixed like this:
I messed up a time with this issue, and I tried with permissions
chown node:node
, also somechmod -R 777
, but nothing worked for me, so I installedsudo apt-get
into Linux distro.Hope this help anyone.
Try using
yarn
package manager or downgradingnpm
to version 7. For me it worked correctly.I’m using Jenkins in an alpine linux container with node 16.
The error I was getting is the following:
In my same case export the environment variable cypress cache folder did not work as expected, the error was even made mentioned above.