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

**Code:** `E402` · **Category:** npm · **Seen on:** npm

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/e402-payment-required)
