Skip to content

Commit

Permalink
add the --legacy-peer-deps config
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 6, 2020
1 parent f9c2655 commit 01300dd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,25 @@ such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.

#### legacy-peer-deps

* Default: false
* Type: Boolean

Causes npm to completely ignore `peerDependencies` when building a package
tree, as in npm versions 3 through 6.

If a package cannot be installed because of overly strict
`peerDependencies` that collide, it provides a way to move forward
resolving the situation.

This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking
`peerDependencies` on disk, but will still design a tree such that
`peerDependencies` _could_ be unpacked in a correct place.

Use of `legacy-peer-deps` is not recommended, as it will not enforce the
`peerDependencies` contract that meta-dependencies may rely on.

#### link

* Default: false
Expand Down
2 changes: 2 additions & 0 deletions lib/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
json: false,
key: null,
'legacy-bundling': false,
'legacy-peer-deps': false,
link: false,
'local-address': undefined,
loglevel: 'notice',
Expand Down Expand Up @@ -316,6 +317,7 @@ exports.types = {
json: Boolean,
key: [null, String],
'legacy-bundling': Boolean,
'legacy-peer-deps': Boolean,
link: Boolean,
'local-address': getLocalAddresses(),
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
Expand Down
1 change: 1 addition & 0 deletions lib/config/flat-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({
legacyBundling: npm.config.get('legacy-bundling'),
scriptShell: npm.config.get('script-shell') || undefined,
omit: buildOmitList(npm),
legacyPeerDeps: npm.config.get('legacy-peer-deps'),

// used to build up the appropriate {add:{...}} options to Arborist.reify
save: npm.config.get('save'),
Expand Down

0 comments on commit 01300dd

Please sign in to comment.