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
- Default:
"https://registry.npmjs.org/" - Type: URL
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 registrynpm help confignpm help npmrcnpm help ownernpm help whoaminpm help tokennpm 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
- centos-stream 10: nodejs26-npm 1:11.19.1-1.26.8.2.1.el10 Β· Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
- centos-stream 9: npm 1:11.19.1-1.26.8.2.2.module_el9+1444+554f3837 Β· Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
- nixpkgs unstable: heroku 11.11.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms