Permission denied error when trying to install pnpm via Corepack as node user
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, node.js
- 领域
- devops, infrastructure
调研方向
首先,使用文档中针对 node:lts-alpine 的 Docker 命令以及非特权用户 -u node 重现该失败。检查镜像如何配置 Corepack 和可写路径;当 corepack enable 以 node 身份成功执行,并且文档中的 pnpm install 流程无需 root 即可正常工作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Environment
- Node.js Version: 16.15.0
- Image Tag: lts-alpine
Expected Behavior
I should be able to install pnpm using Corepack as a non-privilegied user.
Current Behavior
When I try to install pnpm via Corepack (corepack enable) as non-privilegied user (-u node), I get the following error:
/app $ corepack enable
Internal Error: EACCES: permission denied, symlink '../lib/node_modules/corepack/dist/pnpm.js' -> '/usr/local/bin/pnpm'
Error: EACCES: permission denied, symlink '../lib/node_modules/corepack/dist/pnpm.js' -> '/usr/local/bin/pnpm'
/app $
Running corepack enable as root work as expected.
docker run -it -v $(pwd):/app node:lts-alpine /bin/sh

Steps to Reproduce
-
Create an empty project with the following
package.json. ThepackageManagerproperty is important here.{ "name": "docker-node-pnpm", "version": "1.0.0", "private": true, "packageManager": "[email protected]" } -
Run the container as a non-privilegied user:
docker run -it -v $(pwd):/app -u node node:lts-alpine /bin/sh -
cd /app -
corepack enable<-- This should fail -
corepack prepare -
pnpm install
- 主要语言
- Dockerfile
- 星标
- 8.6k
- 派生
- 2k
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/docker-node 的其他 Issue
-
alpine build process
难度 2/5 1-3 小时 新手友好度 67/100
nodejs/docker-node#2707 ·
维护者通常 1 天内回复
-
build process
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#2671 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#1779 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#1707 · 3 条评论 · 7 个 reaction ·
维护者通常 1 天内回复
-
docs
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#1101 · 2 条评论 ·
维护者通常 1 天内回复
查看 nodejs/docker-node 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
serapeum-org/Digital-Earth#567 ·
维护者通常 1 天内回复
-
area: ci enhancement perceived difficulty: 1
难度 2/5 1-3 小时 新手友好度 72/100
Nitjsefnie-Harness-Commons/daedalus#1859 ·
维护者通常 1 天内回复
-
github_actions good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
-
ci reactjs typescript web
难度 2/5 1-3 小时 新手友好度 80/100
mhnuk2007/finsim#175 · 1 条评论 ·
维护者通常 1 天内回复