meteor publish command publishes a new version of a package to the Meteor package server.
Usage
Basic Usage
Publish a package from the current directory:package.js file.
Requirements
Before publishing:- Version: Your package must have an explicit version set in
Package.describe() - Login: You must be logged in (
meteor login) - Package.js: A valid
package.jsfile must exist - Build: The package must build successfully
First-Time Publishing
When publishing a package for the first time, use the--create flag:
Package Naming
Package names should include your username as a prefix:Updating Package Metadata
To update metadata for an already-published version without re-publishing:- Git URL
- Version summary
- Long-form description
- Documentation
Options
boolean
default:"false"
Publish a new package (first-time publishing)
boolean
default:"false"
Update metadata of a previously published version without re-publishing the package
boolean
default:"false"
Allow packages in your project to be upgraded or downgraded to versions that are potentially incompatible with the current versions, if required to satisfy all package version constraints.
boolean
default:"false"
Don’t run linters on the published package and its local dependencies before publishing
string
Specify the release of Meteor to resolve top-level version conflicts. Useful during migration when dealing with packages that have conflicting version requirements.
boolean
default:"false"
Create a top-level package without an account prefix (administrators only)
boolean
default:"false"
(Internal) Publish using existing version with local source code. Good for bootstrapping core releases.
Examples
Publish a package for the first time:Package Structure
A publishable package must have apackage.js file:
Documentation
Your package should include documentation in a README file:- Must not be blank
- Should explain how to use your package
- Can use Markdown formatting
- Will be displayed on the package page
Binary Packages
If your package contains binary code (native npm modules with C/C++ dependencies):Automatic Compilation (Meteor 1.4+)
Meteor 1.4 and higher automatically compile packages with binary dependencies when they are installed, assuming the target machine has a basic compiler toolchain. Requirements: See node-gyp platform requirementsPublishing for Multiple Architectures
You can publish builds for specific architectures:- 32-bit Linux
- 64-bit Linux
- 64-bit macOS
Versioning
Follow semantic versioning (semver):- Patch (1.0.x): Bug fixes, no API changes
- Minor (1.x.0): New features, backward compatible
- Major (x.0.0): Breaking changes
Managing Maintainers
View or change package maintainers:Authentication
Log in before publishing:Publishing Workflow
- Create or update your package code
- Update version in
package.js - Test the package thoroughly
- Update documentation in README
- Run linters (or use
--no-lintif needed) - Log in to Meteor account
- Publish the package
- Verify the package with
meteor show
Troubleshooting
Version Already Exists
If the version already exists, increment the version number inpackage.js.
Blank README
You cannot publish with a blank README. Either:- Fill out the README
- Set
documentation: nullinPackage.describe()
Package Not Found
Ensure you’re in the correct directory containingpackage.js.
Linting Errors
Fix linting errors or use--no-lint to skip linting:
Not Logged In
Runmeteor login before publishing.
Testing Before Publishing
Test your package before publishing:After Publishing
After successfully publishing:- The package is immediately available for others to use
- Refresh the catalog to see your update:
- View package information:
Best Practices
- Test thoroughly before publishing
- Use semantic versioning correctly
- Write good documentation in your README
- Keep dependencies minimal to avoid conflicts
- Specify version constraints for dependencies
- Don’t publish breaking changes in minor/patch versions
- Consider backward compatibility when updating