cypress: Cypress cannot write to the cache directory due to file permissions (Even as root)
Hello,
Cypress cannot write to the cache directory due to file permissions
(Wrote in the chat but just saw other peoples concerns being solved and mine left alone)
I’m running NPM as root when installing things.
From logs
bitnami@bitnami-djangostack-dm-508e:~/apps/logima/vue-storefront$ sudo npm install --no-save vue-eslint-parser@2.0.1-beta.2
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/jest as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/jest
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/uglifyjs as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/uglify-js
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/semver as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/semver
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/nopt as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/nopt
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/json5 as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/json5
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/jsesc as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/jsesc
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/esvalidate as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/esprima
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/esparse as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/esprima
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/browserslist as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/browserslist
npm WARN rm not removing /opt/bitnami/apps/logima/vue-storefront/node_modules/.bin/babylon as it wasn't installed by /opt/bitnami/apps/logima/vue-storefront/node_modules/babylon
node-sass@4.9.3 install /opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass
node scripts/install.js
Unable to save binary /opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/opt/bitnami/apps/logima/vue-storefront/node_modules/mkdirp/index.js:71:13)
at Function.sync (/opt/bitnami/apps/logima/vue-storefront/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/opt/bitnami/apps/logima/vue-storefront/node_modules/node-sass/vendor' }
cypress@3.0.3 postinstall /opt/bitnami/apps/logima/vue-storefront/node_modules/cypress
node index.js --exec install
Cypress cannot write to the cache directory due to file permissions
Failed to access /root/.cache/Cypress:
EACCES: permission denied, mkdir '/root/.cache/Cypress'
Platform: linux (Debian - 9.6)
Cypress Version: 3.0.3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress@3.0.3 postinstall: `node index.js --exec insta
5568 error Failed at the cypress@3.1.4 postinstall script.
5568 error This is probably not a problem with npm. There is likely additional $
5569 verbose exit [ 1, true ]
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 19 (5 by maintainers)
Commits related to this issue
- Use multi-stage builds Use multi-stage builds to split up the steps in the build process. Also, hoped to reduce the final image size but still seeing 1.2GB. Other thing to note is we tried setting a... — committed to DEFRA/sroc-charging-module-api-tests by Cruikshanks 2 years ago
- Set a working directory in the image Prior to this change we were just installing everything into the root of the image. This would be the same as installing a new app into `c:\` on Windows or `/` on... — committed to DEFRA/sroc-charging-module-api-tests by Cruikshanks 2 years ago
- Use multi-stage builds Use multi-stage builds to split up the steps in the build process. Also, hoped to reduce the final image size but still seeing 1.2GB. Other thing to note is we tried setting a... — committed to DEFRA/sroc-charging-module-api-tests by Cruikshanks 2 years ago
- Set a working directory in the image Prior to this change we were just installing everything into the root of the image. This would be the same as installing a new app into `c:\` on Windows or `/` on... — committed to DEFRA/sroc-charging-module-api-tests by Cruikshanks 2 years ago
- Run tests in Docker (#48) * Set up `.env` for Docker We will supply the required environment variables for Docker. For running locally, this means creating a `.env` file and passing it in the `doc... — committed to DEFRA/sroc-charging-module-api-tests by StuAA78 2 years ago
Hello This might not be 100% correct, but you can get away with
npm install -g cypress --unsafe-perm --silentnpm install -g cypress --unsafe-perm --silentdidn’t work for meSince 7 version NPM removed some parameters like user and changed behaviour for NPM running from root.
https://github.com/npm/cli/blob/latest/changelogs/CHANGELOG-7.md#all-lifecycle-scripts
Check a directory you run npm from permissions:
In case of it is not 0 (root) and you run
npm iornpm cifrom root cypress won’t be able to create directory/root/.cache/CypressI have the same problem on alpine linux node 16