--- id: docs_cli_publish guide: docs_cli layout: guide ---

Publishes a package to the npm registry.

Once a package is published, you can never modify that specific version, so take care before publishing. ##### `yarn publish` Publishes the package defined by the `package.json` in the current directory. ##### `yarn publish [tarball]` Publishes the package defined by a `.tgz` gzipped tarball. ##### `yarn publish [folder]` Publishes the package contained in the specified folder. `/package.json` should specify the package details. ##### `yarn publish --new-version ` Skips the prompt for new version by using the value of `version` instead. ##### `yarn publish --tag ` Providing a tag to `yarn publish` lets you publish packages with a specific tag. For example, if you do a `yarn publish --tag beta`, and your package is named `blorp`, then someone else can install that package with `yarn add blorp@beta`. ##### `yarn publish --access ` The `--access` flag controls whether the npm registry publishes this package as a public package, or restricted.