You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8c5ef3d
Browse filesBrowse the repository at this point in the historyBrowse files
Michael Smith
committed
feat!: drop npm-shrinkwrap.json support
BREAKING CHANGE: `npm shrinkwrap` is removed, the `shrinkwrap` config alias is removed, and `npm-shrinkwrap.json` is no longer loaded or honored at the project root or from inside dependency tarballs. Rename project-root `npm-shrinkwrap.json` to `package-lock.json`; use `bundleDependencies` if you need to ship a locked dependency tree.
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-version.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,7 @@ description: Bump a package version
14
14
15
15
### Description
16
16
17
-
Run this in a package directory to bump the version and write the new data back to `package.json`, `package-lock.json`, and, if present,
18
-
`npm-shrinkwrap.json`.
17
+
Run this in a package directory to bump the version and write the new data back to `package.json` and `package-lock.json`.
19
18
20
19
The `newversion` argument should be a valid semver string, a valid second argument to [semver.inc](https://github.com/npm/node-semver#functions) (one of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`, `prerelease`), or `from-git`.
21
20
In the second case, the existing version will be incremented by 1 in the specified field.
Copy file name to clipboardExpand all lines: docs/lib/content/configuring-npm/package-json.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -301,7 +301,7 @@ Some files are always ignored by default:
301
301
*`config.gypi`
302
302
*`node_modules`
303
303
*`npm-debug.log`
304
-
*`package-lock.json` (use [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) if you wish it to be published)
304
+
*`package-lock.json`
305
305
*`pnpm-lock.yaml`
306
306
*`yarn.lock`
307
307
*`bun.lockb`
@@ -872,7 +872,7 @@ These changes can be scoped as specific or as vague as desired.
872
872
873
873
Overrides are only considered in the root `package.json` file for a project.
874
874
Overrides in installed dependencies (including [workspaces](/using-npm/workspaces)) are not considered in dependency tree resolution.
875
-
Published packages may dictate their resolutions by pinning dependencies or using an [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) file.
875
+
Published packages may dictate their resolutions by pinning dependencies or using [`bundleDependencies`](#bundledependencies).
876
876
877
877
To make sure the package `@npm/foo` is always installed as version `1.0.0` no matter what version your dependencies rely on:
Copy file name to clipboardExpand all lines: docs/lib/content/configuring-npm/package-lock-json.md
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,16 @@ This file is intended to be committed into source repositories, and serves vario
23
23
24
24
When `npm` creates or updates `package-lock.json`, it will infer line endings and indentation from `package.json` so that the formatting of both files matches.
25
25
26
-
### `package-lock.json` vs `npm-shrinkwrap.json`
26
+
### `npm-shrinkwrap.json`
27
27
28
-
Both of these files have the same format, and perform similar functions in the root of a project.
29
-
30
-
The difference is that `package-lock.json` cannot be published, and it will be ignored if found in any place other than the root project.
31
-
32
-
In contrast, [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) allows publication, and defines the dependency tree from the point encountered.
33
-
This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages.
34
-
35
-
If both `package-lock.json` and `npm-shrinkwrap.json` are present in the root of a project, `npm-shrinkwrap.json` will take precedence and `package-lock.json` will be ignored.
28
+
As of npm v12, `npm-shrinkwrap.json` is no longer read or written by
29
+
npm. Projects that previously committed `npm-shrinkwrap.json` should
30
+
rename it to `package-lock.json`; the file format is identical. When
31
+
npm v12 encounters a dependency that ships an `npm-shrinkwrap.json`
32
+
inside its tarball, the file is ignored — publishers who need to ship
@@ -115,8 +115,6 @@ Package descriptors have the following fields:
115
115
116
116
* hasInstallScript: A flag to indicate that the package has a `preinstall`, `install`, or `postinstall` script.
117
117
118
-
* hasShrinkwrap: A flag to indicate that the package has an `npm-shrinkwrap.json` file.
119
-
120
118
* bin, license, engines, dependencies, optionalDependencies: fields from `package.json`
121
119
122
120
* os: An array of operating systems this package is compatible with, as specified in `package.json`. This field is included when the package specifies OS restrictions.
@@ -176,7 +174,5 @@ Dependency objects have the following fields:
0 commit comments