npm/pnpm/yarn
Publish Commands
Publish packages to the npm registry. Learn version management, scoped packages, access control, and best practices for maintaining public and private packages.
9 commands
Pro Tips
Use 'npm pack --dry-run' to see exactly which files will be included in your published package.
Use 'npm version patch|minor|major' to bump version, create a git tag, and update package.json in one command.
Add 'files' field in package.json to whitelist published files — more reliable than .npmignore.
Common Mistakes
Published packages cannot be fully deleted after 72 hours — only unpublished. Double-check before publishing.
Accidentally publishing private code is a common mistake. Use 'private: true' in package.json for non-publishable packages.