Permission denied error when trying to install pnpm via Corepack as node user
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, node.js
- Domain
- devops, infrastructure
Research direction
Start by reproducing the failure with the documented node:lts-alpine Docker commands and the non-privileged -u node user. Review how the image configures Corepack and writable paths; done means corepack enable succeeds as node and the documented pnpm install flow works without root.
Written by the indexing model from the issue text.
Description
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": "pnpm@7.1.7" } -
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
- Dominant language
- Dockerfile
- Stars
- 8.6k
- Forks
- 2k
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/docker-node
-
build process docs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nodejs/docker-node#2564 · 2 comments ·
-
build process
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nodejs/docker-node#2437 ·
-
build process
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
nodejs/docker-node#2436 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nodejs/docker-node#1779 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nodejs/docker-node#1707 · 3 comments · 7 reactions ·
All issues in nodejs/docker-node
Similar issues
-
Add dependabot Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
oblt-aw/detector/security
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Type: AVM :a: :v: :m: Type: Bug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Azure/bicep-registry-modules#7386 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100