Bugfix: How to fix npm 403 Forbidden errors during yarn install on G...
Documentation for Sessions
🐛 Bugfix: How to fix npm 403 Forbidden errors during yarn install on G...
Date: 2026-02-25
Time: 21:35:28 UTC
Session: gspace1-142.3
Agent: orchestrator
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How to fix npm 403 Forbidden errors during yarn install on GitHub Actions (Windows/Linux)?
Task: Fix Vitto Desktop CI/CD release workflow
🎯 Decision Made
Chosen:
Remove
registry-url: 'https://registry.npmjs.org'andNODE_AUTH_TOKEN: $GITHUB_TOKENfrom setup-node. Also removepackages: readpermission. Add a 3-attempt retry loop with 15s backoff for intermittent CDN failures.
Options Considered:
- Remove registry-url + NODE_AUTH_TOKEN (fix auth poisoning)
- Add retry loop for transient CDN failures
- Switch to npm ci instead of yarn install
- Use npm registry mirror/proxy
- Add resolutions to force newer tr46 version
💭 Reasoning
Two root causes: (1) registry-url + NODE_AUTH_TOKEN=$GITHUB_TOKEN causes npm to authenticate to npmjs.org with a GitHub token, which npmjs.org rejects with 403 — this project uses ONLY the public registry with no private packages. (2) Even after removing auth, GitHub Actions runners share IPs and hit transient 403 rate limits from npm CDN (especially for old packages like [email protected]). The retry loop handles case 2. Previous 'fix' of ADDING registry-url was wrong and was the actual cause of case 1.
📁 Files Involved
.github/workflows/release-vitto-desktop.yml
🔗 Related
- Decision ID:
dev_1772055328158_7701y3u - Session: 142
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation