Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-access.md96 linesDownload Raw Back to commands
1---
2title: npm-access
3section: 1
4description: Set access level on published packages
5---
6
7### Synopsis
8
9```bash
10npm access list packages [<user>|<scope>|<scope:team>] [<package>]
11npm access list collaborators [<package> [<user>]]
12npm access get status [<package>]
13npm access set status=public|private [<package>]
14npm access set mfa=none|publish|automation [<package>]
15npm access grant <read-only|read-write> <scope:team> [<package>]
16npm access revoke <scope:team> [<package>]
17```
18
19Note: This command is unaware of workspaces.
20
21### Description
22
23Used to set access controls on private packages.
24
25For all of the subcommands, `npm access` will perform actions on the packages in the current working directory if no package name is passed to the subcommand.
26
27* grant / revoke:
28  Add or remove the ability of users and teams to have read-only or read-write access to a package.
29
30### Details
31
32`npm access` always operates directly on the current registry, configurable from the command line using `--registry=<registry url>`.
33
34Unscoped packages are *always public*.
35
36Scoped packages *default to restricted*, but you can either publish them as public using `npm publish --access=public`, or set their access as public using `npm access set status=public` after the initial publish.
37
38You must have privileges to set the access of a package:
39
40* You are an owner of an unscoped or scoped package.
41* You are a member of the team that owns a scope.
42* You have been given read-write privileges for a package, either as a member of a team or directly as an owner.
43
44If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on the command line.
45
46If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use
47`--access=public`.
48
49Management of teams and team memberships is done with the `npm team` command.
50
51### Configuration
52
53#### `json`
54
55* Default: false
56* Type: Boolean
57
58Whether or not to output JSON data, rather than the normal output.
59
60* In `npm pkg set` it enables parsing set values with JSON.parse() before
61  saving them to your `package.json`.
62
63Not supported by all npm commands.
64
65
66
67#### `otp`
68
69* Default: null
70* Type: null or String
71
72This is a one-time password from a two-factor authenticator. It's needed
73when publishing or changing package permissions with `npm access`.
74
75If not set, and a registry response fails with a challenge for a one-time
76password, npm will prompt on the command line for one.
77
78
79
80#### `registry`
81
82* Default: "https://registry.npmjs.org/"
83* Type: URL
84
85The base URL of the npm registry.
86
87
88
89### See Also
90
91* [`libnpmaccess`](https://npm.im/libnpmaccess)
92* [npm team](/commands/npm-team)
93* [npm publish](/commands/npm-publish)
94* [npm config](/commands/npm-config)
95* [npm registry](/using-npm/registry)
96 
codekingpro/portable-devtools · Team Ai