1---
2section: cli-commands
3title: npm-access
4description: Set access level on published packages
5---
6
7# npm-access(1)
8
9## Set access level on published packages
10
11### Synopsis
12
13```bash
14npm access public [<package>]
15npm access restricted [<package>]
16
17npm access grant <read-only|read-write> <scope:team> [<package>]
18npm access revoke <scope:team> [<package>]
19
20npm access 2fa-required [<package>]
21npm access 2fa-not-required [<package>]
22
23npm access ls-packages [<user>|<scope>|<scope:team>]
24npm access ls-collaborators [<package> [<user>]]
25npm access edit [<package>]
26```
27
28### Description
29
30Used to set access controls on private packages.
31
32For all of the subcommands, `npm access` will perform actions on the packages
33in the current working directory if no package name is passed to the
34subcommand.
35
36* public / restricted:
37  Set a package to be either publicly accessible or restricted.
38
39* grant / revoke:
40  Add or remove the ability of users and teams to have read-only or read-write
41  access to a package.
42
43* 2fa-required / 2fa-not-required:
44  Configure whether a package requires that anyone publishing it have two-factor
45  authentication enabled on their account.
46
47* ls-packages:
48  Show all of the packages a user or a team is able to access, along with the
49  access level, except for read-only public packages (it won't print the whole
50  registry listing)
51
52* ls-collaborators:
53  Show all of the access privileges for a package. Will only show permissions
54  for packages to which you have at least read access. If `<user>` is passed in,
55  the list is filtered only to teams _that_ user happens to belong to.
56
57* edit:
58  Set the access privileges for a package at once using `$EDITOR`.
59
60### Details
61
62`npm access` always operates directly on the current registry, configurable
63from the command line using `--registry=<registry url>`.
64
65Unscoped packages are *always public*.
66
67Scoped packages *default to restricted*, but you can either publish them as
68public using `npm publish --access=public`, or set their access as public using
69`npm access public` after the initial publish.
70
71You must have privileges to set the access of a package:
72
73* You are an owner of an unscoped or scoped package.
74* You are a member of the team that owns a scope.
75* You have been given read-write privileges for a package, either as a member
76  of a team or directly as an owner.
77
78If you have two-factor authentication enabled then you'll have to pass in an
79otp with `--otp` when making access changes.
80
81If your account is not paid, then attempts to publish scoped packages will fail
82with an HTTP 402 status code (logically enough), unless you use
83`--access=public`.
84
85Management of teams and team memberships is done with the `npm team` command.
86
87### See Also
88
89* [`libnpmaccess`](https://npm.im/libnpmaccess)
90* [npm team](/cli-commands/npm-team)
91* [npm publish](/cli-commands/npm-publish)
92* [npm config](/cli-commands/npm-config)
93* [npm registry](/using-npm/registry)
94