diff options
author | npm team <ops+robot@npmjs.com> | 2021-07-29 16:11:38 +0000 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2021-07-30 12:35:22 +0000 |
commit | 317e71b142fcc5892f102c3a0220577e50cec55f (patch) | |
tree | d4617fa9e3a2d3fe77ef2728d845030e836d364f /deps/npm/lib | |
parent | 08ef0ae998df5b7bb99e23ec9b82b27854589495 (diff) | |
download | node-new-317e71b142fcc5892f102c3a0220577e50cec55f.tar.gz |
deps: upgrade npm to 7.20.3
PR-URL: https://github.com/nodejs/node/pull/39579
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Diffstat (limited to 'deps/npm/lib')
-rw-r--r-- | deps/npm/lib/utils/explain-eresolve.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/deps/npm/lib/utils/explain-eresolve.js b/deps/npm/lib/utils/explain-eresolve.js index fa3c6bda52..b25e3e4a9c 100644 --- a/deps/npm/lib/utils/explain-eresolve.js +++ b/deps/npm/lib/utils/explain-eresolve.js @@ -9,26 +9,33 @@ const { explainEdge, explainNode, printNode } = require('./explain-dep.js') // The full report (ie, depth=Infinity) is always written to the cache folder // at ${cache}/eresolve-report.txt along with full json. const explain = (expl, color, depth) => { - const { edge, current, peerConflict, currentEdge } = expl + const { edge, dep, current, peerConflict, currentEdge } = expl const out = [] - if (edge.from && edge.from.whileInstalling) - out.push('While resolving: ' + printNode(edge.from.whileInstalling, color)) + const whileInstalling = dep && dep.whileInstalling || + current && current.whileInstalling || + edge && edge.from && edge.from.whileInstalling + if (whileInstalling) + out.push('While resolving: ' + printNode(whileInstalling, color)) // it "should" be impossible for an ERESOLVE explanation to lack both // current and currentEdge, but better to have a less helpful error // than a crashing failure. if (current) out.push('Found: ' + explainNode(current, depth, color)) + else if (peerConflict && peerConflict.current) + out.push('Found: ' + explainNode(peerConflict.current, depth, color)) else if (currentEdge) out.push('Found: ' + explainEdge(currentEdge, depth, color)) + else /* istanbul ignore else - should always have one */ if (edge) + out.push('Found: ' + explainEdge(edge, depth, color)) out.push('\nCould not resolve dependency:\n' + explainEdge(edge, depth, color)) if (peerConflict) { const heading = '\nConflicting peer dependency:' - const pc = explainNode(peerConflict, depth, color) + const pc = explainNode(peerConflict.peer, depth, color) out.push(heading + ' ' + pc) } |