Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error "EACCES: permission denied" when i install cypress

Tags:

cypress

When i try to install cypress using this commnad:

sudo npm install cypress

or

sudo npm install -g cypress

It is giving me this error:

Error: EACCES: permission denied, open '/Users/humac/node_modules/cypress/cypress.zip'

like image 732
user10751590 Avatar asked Mar 13 '19 21:03

user10751590


2 Answers

Workaround: sudo npm install --unsafe-perm=true --allow-root cypress

like image 76
João Neves Filho Avatar answered Sep 17 '22 14:09

João Neves Filho


In my case cypress had trouble accessing /root/.cache/Cypress upon npm install:

EACCES: permission denied, mkdir '/root/.cache/Cypress'

I found a relevant issue and ended up setting a custom cache dir:

export CYPRESS_CACHE_FOLDER=/app/.cache
npm install
like image 40
thisismydesign Avatar answered Sep 16 '22 14:09

thisismydesign