v6.0.0
Breaking Changes
-
Node.js v10 support is dropped. At least Node.js v12.17 is required for the package to work.
-
Arbitrary pre/post hooks for user-defined scripts (such as
prestart) are not executed automatically #2891. -
The lockfile version is bumped to v5.3. Changes in the new format:
- Blank lines added between package/project entries to improve readability and decrease merge issues.
- The
resolution,engines,os, andcpufields are now always written in a single lines, as the first keys of the package objects. - A new field is added to the package objects:
transitivePeerDependencies.
-
The layout of the virtual store directory has changed (
node_modules/.pnpm) to allow keeping cache in it:- All packages inside the virtual store directory are on the same depth. Instead of subdirectories, one directory is used with
#instead of slashes. - New setting added:
modules-cache-max-age. The default value of the setting is 10080 (7 days in seconds).modules-cache-max-ageis the time in minutes after which pnpm should remove the orphan packages fromnode_modules.
- All packages inside the virtual store directory are on the same depth. Instead of subdirectories, one directory is used with
-
pnpx does not automatically install packages. A prompt asks the user if a package should be installed, if it is not present.
pnpx --yestells pnpx to install any missing package.pnpx --nomakes pnpx fail if the called packages is not installed. -
pnpmfile.jsrenamed to.pnpmfile.cjsin order to force CommonJS. -
.pnp.jsrenamed to.pnp.cjsin order to force CommonJS. -
The
pnpm-prefixsetting is removed. Useglobal-dirto specify a custom location for the globally installed packages. -
The default depth of an update is
Infinity, not0. -
The
--globaloption should be used when linking from/to the global modules directory.Linking a package to the global directory:
- pnpm v5:
pnpm link - pnpm v6:
pnpm link --global
Linking a package from the global directory:
- pnpm v5:
pnpm link foo - pnpm v6:
pnpm link --global foo
- pnpm v5:
-
pnpm's command file's extension changed to
.cjs(bin/pnpm.js=>bin/pnpm.cjs). -
node-gyp updated to v8.
-
prepublishis not executed on a localpnpm install. Useprepareinstead.
Features
-
A new command added: pnpm fetch.
Fetch packages from a lockfile into virtual store, package manifest is ignored.
This command is specifically designed to boost building a docker image. -
Overrides match dependencies by checking if the target range is a subset of the specified range, instead of making an exact match.
For example, the following override will replace any version of
foothat has a subrange on v2:"pnpm": { "overrides": { "foo@2": "2.1.0" } }
This will override
foo@2.2.0andfoo@^2.3.0tofoo@2.1.0as both2.2.0and^2.3.0are subranges of2.