2025-03-14 21:59:59 -06:00
|
|
|
# npm adduser
|
|
|
|
|
|
|
|
|
|
> Add a registry user account.
|
|
|
|
|
> More information: <https://docs.npmjs.com/cli/npm-adduser>.
|
|
|
|
|
|
|
|
|
|
- Create a new user in the specified registry and save credentials to `.npmrc`:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`npm adduser --registry {{registry_url}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Log in to a private registry with a specific scope:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`npm login --scope {{@organization}} --registry {{https://registry.example.com}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Log out from a specific scope and remove the auth token:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`npm logout --scope {{@organization}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Create a scoped package during initialization:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`npm init --scope {{@organization}} {{[-y|--yes]}}`
|