# corepack enable "EACCES permission denied" - Fix Shim Install in CI

> Fix "corepack enable" failing with EACCES in CI/Docker - Corepack cannot write yarn/pnpm shims into a Node bin directory owned by root.

Source: https://latchkey.dev/learn/node-js/corepack-enable-permission-denied  
Updated: 2026-06-25

corepack enable writes yarn/pnpm shims into Node’s install bin directory. If that directory is root-owned and the build runs as non-root, the symlink creation fails with EACCES.

## Diagnose it: which registry, and with what credentials?

Registry errors are resolved in a precedence chain, and the effective value is rarely the one in the file you are looking at. Scoped registries, `.npmrc` files at several levels, and environment variables all combine before a request is made.

```Terminal
# the effective, fully merged configuration
npm config list -l | grep -E "registry|_auth|always-auth"

# where each value came from
npm config get registry
npm config get @yourscope:registry

# prove the token works, independently of the install
curl -sI -H "Authorization: Bearer $NPM_TOKEN" \
  "$(npm config get registry)@yourscope%2fpackage" | head -1
```

> A private package 404s rather than 401s when the token lacks read access, because the registry will not confirm that a package you cannot see exists. Treat an unexpected 404 on a private scope as an auth problem, not a missing package.

## FAQ

### What causes corepack enable "EACCES permission denied"?

There are 2 common causes: the node bin directory is owned by root and corepack enable run without sufficient privilege. Corepack tries to symlink shims into e.g.

### How do I fix corepack enable "EACCES permission denied"?

There are 2 fixes depending on which cause you have: enable corepack with the right privilege or target and fix ownership of the bin path. Work through them in order, since the first is the most common.

### What does corepack enable "EACCES permission denied" actually mean?

corepack enable errors with EACCES while creating shims in a Node bin path.

### How do I stop corepack enable "EACCES permission denied" happening again?

Enable Corepack at image-build time as root. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
