The classic npm permission clusterfuck just got worse. Node.js decided to add more "security" that mostly just breaks everything.
Node.js 22 Permission Model Bullshit
Node.js 22 has this new permission model that's supposed to make things "more secure." What it actually does is break npm installs that used to work fine.
I spent 4 hours debugging this last week. The error messages are completely useless:
Error: EACCES: permission denied, symlink '../lib/node_modules/@package/bin/cli.js' -> '/usr/local/bin/package'
Error: permission denied, sys call 'access' at path '/home/user/.npm'
That second one is my favorite - "permission denied, sys call 'access'" tells you absolutely nothing about what actually broke.
This Stack Overflow thread has 200+ people with the same useless error. Another one shows the problem affects Windows and Linux too.
The new permission system blocks npm from:
- Creating symlinks (which breaks most CLI tools)
- Writing to npm cache during installs
- Accessing system paths that native modules need
corepack: Making Everything Worse
Corepack is enabled by default in Node.js 20+. It's supposed to "manage package managers" but mostly just fucks with npm.
Here's what corepack breaks:
npm install -g
suddenly requires admin rights on Windows- Global packages fail randomly when corepack intercepts commands
corepack enable
writes to Node.js directories you don't own
I found this GitHub issue where even running as Administrator doesn't work on Windows. Great job, Node.js team.
This npm GitHub issue documents similar permission problems. Another Windows-specific thread shows the same EPERM errors that make no sense.
WSL2: Peak Permission Hell
WSL2 is where npm permissions go to die. You get the worst of both Windows AND Linux permissions in one cursed setup.
WSL2 npm disasters I've encountered:
- VS Code opens a project in
/mnt/c/
and npm can't create symlinks - Windows Defender scans your
node_modules
and corrupts npm cache - Files get mixed ownership between Windows and Linux
- npm thinks it's on Windows but it's actually Linux (or vice versa)
The error you'll see: EACCES: permission denied
with no indication it's a cross-platform clusterfuck.
Microsoft's WSL docs explain why this happens but don't tell you how to actually fix it. Thanks, Microsoft.
This SuperUser thread shows Ubuntu users hitting the same problems. Stack Overflow discussions document the pain across all platforms.
npm 10.x: More Security Theater
npm 10.x (bundled with Node.js 22) decided to add more security checks. Now it validates every directory twice and throws permission errors for setups that worked fine in npm 9.
The new npm security model includes:
- "Enhanced verification" (more shit that breaks)
- "Stricter ownership checks" (because the old ones weren't strict enough?)
- "Symlink target validation" (RIP every CLI tool)
Translation: Your npm setup that worked last month is now broken.
Docker: Adding Container Permission Hell
Docker containers make npm permissions even worse because now you have container users AND host users fighting each other.
This happens constantly:
## Inside container, this fails:
npm install -g @angular/cli
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@angular'
## Even with USER node in Dockerfile
USER node
RUN npm install -g typescript # Still fails, because reasons
Docker's user namespace docs explain the technical details but don't help when you're trying to get work done.
CI/CD: Where Permission Errors Go to Die
Every CI system handles npm permissions differently, and they all break in unique ways:
- GitHub Actions: Works locally, fails in CI with identical Node version
- Jenkins: Docker-in-Docker npm installs fail randomly
- Azure DevOps: npm cache permissions change between builds
I've seen this exact failure probably 50 times:
- name: Install dependencies
run: npm ci
# Fails with: Error: EACCES: permission denied, open '/github/home/.npm/_cacache'
Even NVM Has Problems Now
NVM is still the best solution, but Node.js 22's permission model broke some NVM setups too.
NVM problems I've hit:
- Installing multiple Node versions creates permission conflicts
- Switching Node versions breaks global packages
- npm cache gets fucked when switching between Node 18/20/22
The dumb thing: NVM's latest version fixes some of this, but upgrading NVM when your npm is already broken is a catch-22.
How Much Time This Wastes
Here's the reality: npm permission debugging sucks away entire afternoons.
Last month I lost 3 hours to a WSL2 + Node 22 + corepack permission nightmare. The "fix" was deleting everything and starting over.
The traditional solutions work maybe half the time now. The other half requires nuclear options or just giving up and using a different computer.
Bottom line: Modern Node.js and npm prioritized "security" over actually working. Now we spend more time debugging permissions than writing code.
The good news? Most of these problems are fixable if you know what to try first. The bad news? You'll need to throw out everything you thought you knew about npm installation.