PHP 8.2.30
Preview: npm-adduser.md Size: 2.93 KB
/proc/self/root/opt/alt/alt-nodejs12/root/lib/node_modules/npm/docs/content/cli-commands/npm-adduser.md

 ---
section: cli-commands
title: npm-adduser
description: Set access level on published packages
---

# npm-adduser(1)

## Add a registry user account

### Synopsis

```bash
npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]

aliases: login, add-user
```

### Description

Create or verify a user named `<username>` in the specified registry, and
save the credentials to the `.npmrc` file. If no registry is specified,
the default registry will be used (see [`config`](/using-npm/config)).

The username, password, and email are read in from prompts.

To reset your password, go to <https://www.npmjs.com/forgot>

To change your email address, go to <https://www.npmjs.com/email-edit>

You may use this command multiple times with the same user account to
authorize on a new machine.  When authenticating on a new machine,
the username, password and email address must all match with
your existing record.

`npm login` is an alias to `adduser` and behaves exactly the same way.

### Configuration

#### registry

Default: https://registry.npmjs.org/

The base URL of the npm package registry. If `scope` is also specified,
this registry will only be used for packages with that scope. `scope` defaults
to the scope of the project directory you're currently in, if any. See [`scope`](/using-npm/scope).

#### scope

Default: none

If specified, the user and login credentials given will be associated
with the specified scope. See [`scope`](/using-npm/scope). You can use both at the same time,
e.g.

```bash
    npm adduser --registry=http://myregistry.example.com --scope=@myco
```    

This will set a registry for the given scope and login or create a user for
that registry at the same time.

#### always-auth

Default: false

If specified, save configuration indicating that all requests to the given
registry should include authorization information. Useful for private
registries. Can be used with `--registry` and / or `--scope`, e.g.

```bash
    npm adduser --registry=http://private-registry.example.com --always-auth
```

This will ensure that all requests to that registry (including for tarballs)
include an authorization header. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
different hostnames. See `always-auth` in [`config`](/using-npm/config) for more details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration.

#### auth-type

* Default: `'legacy'`
* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'`

What authentication strategy to use with `adduser`/`login`. Some npm registries
(for example, npmE) might support alternative auth strategies besides classic
username/password entry in legacy npm.

### See Also

* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm owner](/cli-commands/npm-owner)
* [npm whoami](/cli-commands/npm-whoami)

Directory Contents

Dirs: 0 × Files: 59

Name Size Perms Modified Actions
2.87 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.93 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
4.08 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
452 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.08 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
645 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
416 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.73 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.92 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
936 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.62 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.44 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
953 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.95 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.14 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
4.65 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.07 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.04 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.59 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
910 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
989 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.88 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.17 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
438 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
832 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
19.03 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.75 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.28 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.57 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.01 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
3.86 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.22 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.01 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
519 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
678 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.89 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.38 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
3.12 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
495 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
774 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
962 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
438 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
3.49 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.85 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1004 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
591 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
614 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
798 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
452 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.20 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
469 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
2.80 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.53 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
1.45 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
3.39 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
4.47 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
3.19 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download
385 B lrw-r--r-- 2026-03-09 07:21:28
Edit Download
5.31 KB lrw-r--r-- 2026-03-09 07:21:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).