npm publish
Publish a package to the npm registry. More information: https://docs.npmjs.com/cli/publish/.
- Publish the current package to the default npm registry:
npm publish
- Publish a package from a specific directory:
npm publish
- Publish a scoped package with public access:
npm publish --access public
- Publish a scoped package with restricted (private) access:
npm publish --access restricted
- Publish a package to a custom registry:
npm publish --registry
- Simulate what would be published without uploading:
npm publish --dry-run
- Publish a package with a specific distribution tag (e.g., beta):
npm publish --tag
- Publish with a one-time password for 2FA-enabled accounts:
npm publish --otp
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
