11cb0ef41Sopenharmony_ci--- 21cb0ef41Sopenharmony_cititle: npm-owner 31cb0ef41Sopenharmony_cisection: 1 41cb0ef41Sopenharmony_cidescription: Manage package owners 51cb0ef41Sopenharmony_ci--- 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci### Synopsis 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci```bash 101cb0ef41Sopenharmony_cinpm owner add <user> <package-spec> 111cb0ef41Sopenharmony_cinpm owner rm <user> <package-spec> 121cb0ef41Sopenharmony_cinpm owner ls <package-spec> 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_cialias: author 151cb0ef41Sopenharmony_ci``` 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci### Description 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciManage ownership of published packages. 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_ci* ls: List all the users who have access to modify a package and push new 221cb0ef41Sopenharmony_ci versions. Handy when you need to know who to bug for help. 231cb0ef41Sopenharmony_ci* add: Add a new user as a maintainer of a package. This user is enabled 241cb0ef41Sopenharmony_ci to modify metadata, publish new versions, and add other owners. 251cb0ef41Sopenharmony_ci* rm: Remove a user from the package owner list. This immediately revokes 261cb0ef41Sopenharmony_ci their privileges. 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ciNote that there is only one level of access. Either you can modify a package, 291cb0ef41Sopenharmony_cior you can't. Future versions may contain more fine-grained access levels, but 301cb0ef41Sopenharmony_cithat is not implemented at this time. 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ciIf you have two-factor authentication enabled with `auth-and-writes` (see 331cb0ef41Sopenharmony_ci[`npm-profile`](/commands/npm-profile)) then you'll need to go through a second factor 341cb0ef41Sopenharmony_ciflow when changing ownership or include an otp on the command line with `--otp`. 351cb0ef41Sopenharmony_ci 361cb0ef41Sopenharmony_ci### Configuration 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci#### `registry` 391cb0ef41Sopenharmony_ci 401cb0ef41Sopenharmony_ci* Default: "https://registry.npmjs.org/" 411cb0ef41Sopenharmony_ci* Type: URL 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_ciThe base URL of the npm registry. 441cb0ef41Sopenharmony_ci 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ci#### `otp` 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_ci* Default: null 501cb0ef41Sopenharmony_ci* Type: null or String 511cb0ef41Sopenharmony_ci 521cb0ef41Sopenharmony_ciThis is a one-time password from a two-factor authenticator. It's needed 531cb0ef41Sopenharmony_ciwhen publishing or changing package permissions with `npm access`. 541cb0ef41Sopenharmony_ci 551cb0ef41Sopenharmony_ciIf not set, and a registry response fails with a challenge for a one-time 561cb0ef41Sopenharmony_cipassword, npm will prompt on the command line for one. 571cb0ef41Sopenharmony_ci 581cb0ef41Sopenharmony_ci 591cb0ef41Sopenharmony_ci 601cb0ef41Sopenharmony_ci#### `workspace` 611cb0ef41Sopenharmony_ci 621cb0ef41Sopenharmony_ci* Default: 631cb0ef41Sopenharmony_ci* Type: String (can be set multiple times) 641cb0ef41Sopenharmony_ci 651cb0ef41Sopenharmony_ciEnable running a command in the context of the configured workspaces of the 661cb0ef41Sopenharmony_cicurrent project while filtering by running only the workspaces defined by 671cb0ef41Sopenharmony_cithis configuration option. 681cb0ef41Sopenharmony_ci 691cb0ef41Sopenharmony_ciValid values for the `workspace` config are either: 701cb0ef41Sopenharmony_ci 711cb0ef41Sopenharmony_ci* Workspace names 721cb0ef41Sopenharmony_ci* Path to a workspace directory 731cb0ef41Sopenharmony_ci* Path to a parent workspace directory (will result in selecting all 741cb0ef41Sopenharmony_ci workspaces within that folder) 751cb0ef41Sopenharmony_ci 761cb0ef41Sopenharmony_ciWhen set for the `npm init` command, this may be set to the folder of a 771cb0ef41Sopenharmony_ciworkspace which does not yet exist, to create the folder and set it up as a 781cb0ef41Sopenharmony_cibrand new workspace within the project. 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ciThis value is not exported to the environment for child processes. 811cb0ef41Sopenharmony_ci 821cb0ef41Sopenharmony_ci#### `workspaces` 831cb0ef41Sopenharmony_ci 841cb0ef41Sopenharmony_ci* Default: null 851cb0ef41Sopenharmony_ci* Type: null or Boolean 861cb0ef41Sopenharmony_ci 871cb0ef41Sopenharmony_ciSet to true to run the command in the context of **all** configured 881cb0ef41Sopenharmony_ciworkspaces. 891cb0ef41Sopenharmony_ci 901cb0ef41Sopenharmony_ciExplicitly setting this to false will cause commands like `install` to 911cb0ef41Sopenharmony_ciignore workspaces altogether. When not set explicitly: 921cb0ef41Sopenharmony_ci 931cb0ef41Sopenharmony_ci- Commands that operate on the `node_modules` tree (install, update, etc.) 941cb0ef41Sopenharmony_ciwill link workspaces into the `node_modules` folder. - Commands that do 951cb0ef41Sopenharmony_ciother things (test, exec, publish, etc.) will operate on the root project, 961cb0ef41Sopenharmony_ci_unless_ one or more workspaces are specified in the `workspace` config. 971cb0ef41Sopenharmony_ci 981cb0ef41Sopenharmony_ciThis value is not exported to the environment for child processes. 991cb0ef41Sopenharmony_ci 1001cb0ef41Sopenharmony_ci### See Also 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci* [package spec](/using-npm/package-spec) 1031cb0ef41Sopenharmony_ci* [npm profile](/commands/npm-profile) 1041cb0ef41Sopenharmony_ci* [npm publish](/commands/npm-publish) 1051cb0ef41Sopenharmony_ci* [npm registry](/using-npm/registry) 1061cb0ef41Sopenharmony_ci* [npm adduser](/commands/npm-adduser) 107