NPM-ADDUSER(1)

πŸ’– npm-adduser β€” add a registry user account, bestie πŸ’–

Okay so like, this is from the npm manual, section NPM-ADDUSER(1), and it's genuinely one of the cutest lil commands β€” it literally makes you a whole account. Let's get into it 🫢


✨ NAME ✨

npm-adduser β€” add a registry user account

🌸 Synopsis

npm adduser

alias: add-user
Heads up bestie: this command is unaware of workspaces. Like, it simply does not know they exist. Not its business. πŸ’…

πŸŽ€ DESCRIPTION πŸŽ€

So what it does: it creates a new user in the registry you specify, and saves the credentials to the .npmrc file. If you don't specify a registry, the default registry gets used (peep npm help registry for the deets).

When you run npm adduser, the CLI automatically generates a legacy token of publish type. For more info, see About legacy tokens ⟨/about-access-tokens#about-legacy-tokens⟩. Not me explaining legacy tokens, go read the link 😭

When you're using legacy for your auth-type, the username, password, and email are read in from prompts. So yeah, it's gonna ask you. Just answer the questions, icon. ✨


βš™οΈ CONFIGURATION βš™οΈ

🌈 registry

The base URL of the npm registry. That's it, that's the whole vibe.

πŸ¦‹ scope

  • Default: the scope of the current project, if any, or ""
  • Type: String

Associates an operation with a scope for a scoped registry. So useful when you're logging in to or out of a private registry, fr fr:

# log in, linking the scope to the custom registry
npm login --scope=@mycorp --registry=https://registry.mycorp.com

# log out, removing the link and the auth token
npm logout --scope=@mycorp

This will cause @mycorp to be mapped to the registry for future installation of packages specified according to the pattern @mycorp/package. So every time you install something under that scope, it knows where to go. Slay. πŸ‘‘

This will also cause npm init to create a scoped package:

# accept all defaults, and create a package named "@foo/whatever",
# instead of just named "whatever"
npm init --scope=@foo --yes

So cute, right? Named packages with a lil family name. πŸŽ€

πŸ’œ auth-type

  • Default: "web"
  • Type: "legacy" or "web"

What authentication strategy to use with login. And important caveat time β€” if an otp config is given, this value will always be set to legacy. Like, no discussion. That's just the rule. πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • npm help registry
  • npm help config
  • npm help npmrc
  • npm help owner
  • npm help whoami
  • npm help token
  • npm help profile

That's the whole page, bestie! Go forth and make yourself a whole account, you main character 🌟

NPM@11.19.1 Β· August 2026 Β· NPM-ADDUSER(1) β€” mwah, love u, go read the manpage again if u forgot something πŸ’–πŸ’…πŸ¦‹

πŸ“¦ where this page comes from