E402 📦 npm

npm ERR! code E402 — 402 Payment Required - PUT https://registry.npmjs.org/@scope%2fpkg - You must sign up for private packages

You published a scoped package without --access public, so npm tried to publish it as private.

Seen on: npm

Meaning

Scoped packages default to restricted (private) access, which requires a paid plan.

Common causes

  • First publish of a @scope package without --access public
  • publishConfig.access set to restricted

⚡ Quick fix

  1. npm publish --access public
  2. Or set "publishConfig": { "access": "public" }

Detailed fix by platform

npm

  1. "publishConfig": { "access": "public" }

How to diagnose

  1. Scope — Scoped package?
  2. Access — public set?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.