MCPcopy Index your code
hub / github.com/nodejs/node / report

Function report

deps/npm/lib/utils/explain-eresolve.js:42–59  ·  view source on GitHub ↗
(expl, chalk, noColorChalk)

Source from the content-addressed store, hash-verified

40
41// generate a full verbose report and tell the user how to fix it
42const report = (expl, chalk, noColorChalk) => {
43 const flags = [
44 expl.strictPeerDeps ? '--no-strict-peer-deps' : '',
45 '--force',
46 '--legacy-peer-deps',
47 ].filter(Boolean)
48
49 const or = (arr) => arr.length <= 2
50 ? arr.join(' or ') :
51 arr.map((v, i, l) => i + 1 === l.length ? `or ${v}` : v).join(', ')
52
53 const fix = `Fix the upstream dependency conflict, or retry this command with ${or(flags)} to accept an incorrect (and potentially broken) dependency resolution.`
54
55 return {
56 explanation: `${explain(expl, chalk, 4)}\n\n${fix}`,
57 file: `# npm resolution error report\n\n${explain(expl, noColorChalk, Infinity)}\n\n${fix}`,
58 }
59}
60
61module.exports = {
62 explain,

Callers 2

errorMessageFunction · 0.70

Calls 3

explainFunction · 0.85
orFunction · 0.70
filterMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…