2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
section: configuring-npm
|
|
|
|
title: shrinkwrap.json
|
|
|
|
description: A publishable lockfile
|
|
|
|
---
|
2017-05-28 21:04:08 -07:00
|
|
|
|
2019-11-18 21:01:39 +02:00
|
|
|
# npm-shrinkwrap.json(5)
|
2017-05-28 21:04:08 -07:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
## A publishable lockfile
|
|
|
|
|
|
|
|
### Description
|
|
|
|
|
2020-10-02 17:52:19 -04:00
|
|
|
`npm-shrinkwrap.json` is a file created by [`npm shrinkwrap`](/cli-commands/shrinkwrap). It is identical to
|
2017-05-28 21:04:08 -07:00
|
|
|
`package-lock.json`, with one major caveat: Unlike `package-lock.json`,
|
2017-07-14 10:52:48 -07:00
|
|
|
`npm-shrinkwrap.json` may be included when publishing a package.
|
2017-05-28 21:04:08 -07:00
|
|
|
|
|
|
|
The recommended use-case for `npm-shrinkwrap.json` is applications deployed
|
|
|
|
through the publishing process on the registry: for example, daemons and
|
|
|
|
command-line tools intended as global installs or `devDependencies`. It's
|
|
|
|
strongly discouraged for library authors to publish this file, since that would
|
|
|
|
prevent end users from having control over transitive dependency updates.
|
|
|
|
|
2017-07-14 10:52:48 -07:00
|
|
|
Additionally, if both `package-lock.json` and `npm-shrinkwrap.json` are present
|
2017-05-28 21:04:08 -07:00
|
|
|
in a package root, `package-lock.json` will be ignored in favor of this file.
|
|
|
|
|
|
|
|
For full details and description of the `npm-shrinkwrap.json` file format, refer
|
2019-11-18 21:01:39 +02:00
|
|
|
to the manual page for [package-lock.json](/configuring-npm/package-lock-json).
|
2017-05-28 21:04:08 -07:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See also
|
2017-05-28 21:04:08 -07:00
|
|
|
|
2020-10-02 17:52:19 -04:00
|
|
|
* [npm shrinkwrap](/cli-commands/shrinkwrap)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [package-lock.json](/configuring-npm/package-lock-json)
|
|
|
|
* [package.json](/configuring-npm/package-json)
|
2020-10-02 17:52:19 -04:00
|
|
|
* [npm install](/cli-commands/install)
|