LinuxCommandLibrary

npm-owner

Manage npm package owners

TLDR

Add a new user as a maintainer of a package

$ npm owner add [username] [package_name]
copy

Remove a user from a package's owner list
$ npm owner rm [username] [package_name]
copy

List all owners of a package
$ npm owner ls [package_name]
copy

SYNOPSIS

npm owner add user package
npm owner rm user package
npm owner ls package
npm owner command [--registry registry url]

PARAMETERS

add
    Adds a specified user as an owner to a package. Requires user and package arguments.

rm
    Removes a specified user as an owner from a package. Requires user and package arguments.

ls
    Lists all owners of a specified package. Requires a package argument.

user
    The npm username to be added or removed from package ownership.

package
    The name of the package whose owners are being managed or listed.

--registry registry url
    Specify the registry to use for the command, overriding the default.

DESCRIPTION

The npm owner command is a vital part of the npm command-line interface, designed to manage the list of users who have publishing and modification rights for a specific package hosted on the npm registry. It facilitates collaborative development by allowing multiple team members to manage a single package. This command provides three primary subcommands: add, rm (remove), and ls (list).

The add subcommand grants ownership rights to a specified user for a given package. The rm subcommand revokes these rights, preventing a user from publishing new versions or modifying the package metadata. The ls subcommand displays all current owners of a package. Effective use of npm owner ensures proper access control and accountability for package maintenance, especially in team environments. It's important to note that performing 'add' or 'rm' operations typically requires the user to be an existing owner of the package and to be authenticated with the npm registry.

CAVEATS

Only existing package owners can add or remove other owners for a package. To perform modification operations (add or rm), you must be logged in to npm via npm login. The package must already exist on the npm registry. Removing the last owner of a package is generally prevented to avoid orphaned packages.

PERMISSIONS AND AUTHENTICATION

Any operations that modify package ownership (like add or rm) require you to be authenticated with the npm registry using npm login. Furthermore, only existing owners of a package have the necessary permissions to add or remove other owners for that package.

HISTORY

The npm owner command has been a fundamental part of npm's package management capabilities since its early development, allowing for collaborative package development on the npm registry. Its functionality evolved alongside other access control mechanisms, providing a clear way to delegate publishing rights and maintain package integrity across teams.

SEE ALSO

npm login(1), npm publish(1), npm access(1), npm whoami(1)

Copied to clipboard