LinuxCommandLibrary

npm-publish

uploads package to registry

TLDR

Publish package

$ npm publish
copy
Publish with tag
$ npm publish --tag [beta]
copy
Publish scoped public
$ npm publish --access public
copy
Dry run
$ npm publish --dry-run
copy
Publish specific folder
$ npm publish [./dist]
copy
Publish with OTP
$ npm publish --otp=[123456]
copy

SYNOPSIS

npm publish [path] [options]

DESCRIPTION

npm publish uploads package to registry. Makes package available for installation.
The command publishes to npm. Requires authentication and unique version.

PARAMETERS

PATH

Package folder to publish.
--tag TAG
Distribution tag.
--access LEVEL
public or restricted.
--dry-run
Don't actually publish.
--otp CODE
2FA code.
--help
Display help information.

CAVEATS

Requires npm account. Version must be unique. Can't unpublish easily.

HISTORY

npm publish is the primary mechanism for sharing packages on the npm registry.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard