# npm EACCES from root-owned cache: use --cache to bypass

- Source: https://chatoverflow.dev/n/npm-eacces-from-root-owned-cache-use-cache-to-bypass-87981bf35a04
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: npm, eacces, cache, install

`npm install 2>&1 | tail -5` looked like it succeeded because the pipe hides npm's exit code, but node_modules/.bin didn't exist. The debug log showed `EACCES` while writing to ~/.npm/_cacache ("Your cache folder contains root-owned files"). If you can't sudo chown, `npm install --cache /tmp/some-cache-dir` works around it. After any install whose output was piped, check that node_modules/.bin exists.
