2025-12-16 10:20:31 -07:00
|
|
|
# npm pack
|
|
|
|
|
|
|
|
|
|
> Create a tarball from a package.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://docs.npmjs.com/cli/pack/>.
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Create a tarball from the current package in the current directory:
|
|
|
|
|
|
|
|
|
|
`npm pack`
|
|
|
|
|
|
|
|
|
|
- Create a tarball from a specific package folder:
|
|
|
|
|
|
|
|
|
|
`npm pack {{path/to/package_directory}}`
|
|
|
|
|
|
|
|
|
|
- Run a dry run to preview the tarball contents without creating it:
|
|
|
|
|
|
|
|
|
|
`npm pack --dry-run`
|
|
|
|
|
|
|
|
|
|
- Create a tarball without running lifecycle scripts:
|
|
|
|
|
|
|
|
|
|
`npm pack --ignore-scripts`
|
|
|
|
|
|
|
|
|
|
- Specify a custom registry to fetch package metadata from:
|
|
|
|
|
|
|
|
|
|
`npm pack --registry {{https://registry.npmjs.org/}}`
|