main
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: npm-pack |
| 3 | section: 1 |
| 4 | description: Create a tarball from a package |
| 5 | github_repo: npm/cli |
| 6 | github_branch: release/v6 |
| 7 | github_path: docs/content/commands/npm-pack.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v6/cli-commands/npm-pack |
| 10 | - /cli-documentation/v6/cli-commands/pack |
| 11 | - /cli-documentation/v6/commands/npm-pack |
| 12 | - /cli-documentation/v6/commands/pack |
| 13 | - /cli-documentation/v6/npm-pack |
| 14 | - /cli-documentation/v6/pack |
| 15 | - /cli/v6/cli-commands/npm-pack |
| 16 | - /cli/v6/cli-commands/pack |
| 17 | - /cli/v6/commands/pack |
| 18 | - /cli/v6/npm-pack |
| 19 | - /cli/v6/pack |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm pack [[<@scope>/]<pkg>...] [--dry-run] |
| 26 | ``` |
| 27 | |
| 28 | ### Description |
| 29 | |
| 30 | For anything that's installable (that is, a package folder, tarball, tarball url, name@tag, name@version, name, or scoped name), this command will fetch it to the cache, and then copy the tarball to the current working directory as `<name>-<version>.tgz`, and then write the filenames out to stdout. |
| 31 | |
| 32 | If the same package is specified multiple times, then the file will be overwritten the second time. |
| 33 | |
| 34 | If no arguments are supplied, then npm packs the current package folder. |
| 35 | |
| 36 | The `--dry-run` argument will do everything that pack usually does without actually packing anything. Reports on what would have gone into the tarball. |
| 37 | |
| 38 | ### See Also |
| 39 | |
| 40 | - [npm cache](/cli/v6/commands/npm-cache) |
| 41 | - [npm publish](/cli/v6/commands/npm-publish) |
| 42 | - [npm config](/cli/v6/commands/npm-config) |
| 43 | - [npmrc](/cli/v6/configuring-npm/npmrc) |