【发布时间】:2022-11-05 18:48:03
【问题描述】:
我正在使用 jenkins 执行基于 cypress 的测试用例。我正在使用 cypress 在 github repo https://github.com/cypress-io/cypress-example-kitchensink/blob/master/Jenkinsfile 中提供的厨房水槽示例 但是当我在詹金斯工作中执行这个时,我得到了错误
npm ci
npm WARN prepare removing existing node_modules/ before installation
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 501:20 "/.npm"
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 501:20 "/.npm"
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 501:20 "/.npm"
npm ERR! code EACCES
如需额外信息: Jenkins 安装在我的 MAC 操作系统中并在端口 8080(默认端口)中运行,节点 js 也安装在我的本地系统中,版本为 17.5.0
但是 dockerfile 在上述 repo 示例中使用 docker 中的 cypress 映像并在容器中安装相关依赖项
【问题讨论】:
标签: node.js docker jenkins npm cypress