Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! code EACCES with Docker container based on node14 or newer #797

Closed
kwin opened this issue Dec 8, 2022 · 3 comments
Closed

npm ERR! code EACCES with Docker container based on node14 or newer #797

kwin opened this issue Dec 8, 2022 · 3 comments

Comments

@kwin
Copy link

kwin commented Dec 8, 2022

I tried to execute a docker build in jenkins based on this example: https://github.com/cypress-io/cypress-example-kitchensink/blob/master/basic/Jenkinsfile but all newer versions fail with

$ docker run -t -d -u 1013:1015 -w /var/lib/jenkins/workspace/*** cypress/browsers:node16.18.0-chrome107-ff106-edge cat
$ docker top 252dba70cbbf913bf6d23607236bb379e0d2802990b1b2cbadb923d916857720 -eo pid,comm
[Pipeline] {
[Pipeline] sh
+ npm ci
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /.npm
npm ERR! errno -13
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 1013:1015 "/.npm"

npm ERR! Log files were not written due to an error writing to the directory: /.npm/_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

(the above happened with cypress/browsers:node16.18.0-chrome107-ff106-edge but several other versions are affected as well).

Seems the dockerfile is missing some configurations for global NPM dependencies as outlined in https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#global-npm-dependencies.

@kwin
Copy link
Author

kwin commented Dec 8, 2022

Probably related: nodejs/docker-node#740 (comment)

@MikeMcC399
Copy link
Collaborator

@kwin

Is the issue you describe still occurring in current versions of cypress/browsers?
cypress/browsers:node16.18.0-chrome107-ff106-edge which you mentioned is no longer supported.

@MikeMcC399
Copy link
Collaborator

Closing as stale issue concerning now-unsupported version.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants