-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support reporting on ERESOLVE errors when current is missing
While it is somewhat helpful to get reports on this, since it indicates an underlying problem in Arborist, it's also very disruptive and unhelpful for users. As of 2.3.0, Arborist gives us the currentEdge if available, so we _can_ report on that at least. If there is no node _or_ edge, then we just don't say what the current state is, which isn't useful, but at least is less annoying than a 'property of null' exception. PR-URL: #3015 Credit: @isaacs Close: #3015 Reviewed-by: @wraithgar
- Loading branch information
Showing
3 changed files
with
333 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,6 +418,188 @@ to accept an incorrect (and potentially broken) dependency resolution. | |
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > explain with color 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Found: [33mdev[39m [1meslint[22m@"[1mfile:.[22m" from the root project | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > explain with no color, depth of 6 1`] = ` | ||
While resolving: [email protected] | ||
Found: dev eslint@"file:." from the root project | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > report 1`] = ` | ||
# npm resolution error report | ||
\${TIME} | ||
While resolving: [email protected] | ||
Found: dev eslint@"file:." from the root project | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
Raw JSON explanation object: | ||
{ | ||
"name": "no current node, but has current edge", | ||
"json": true | ||
} | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > report with color 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Found: [33mdev[39m [1meslint[22m@"[1mfile:.[22m" from the root project | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > report with color, depth only 2 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Found: [33mdev[39m [1meslint[22m@"[1mfile:.[22m" from the root project | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, but has current edge > report with no color, depth of 6 1`] = ` | ||
While resolving: [email protected] | ||
Found: dev eslint@"file:." from the root project | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > explain with color 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > explain with no color, depth of 6 1`] = ` | ||
While resolving: [email protected] | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > report 1`] = ` | ||
# npm resolution error report | ||
\${TIME} | ||
While resolving: [email protected] | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
Raw JSON explanation object: | ||
{ | ||
"name": "no current node, no current edge, idk", | ||
"json": true | ||
} | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > report with color 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > report with color, depth only 2 1`] = ` | ||
While resolving: [1meslint[22m@[1m7.22.0[22m | ||
Could not resolve dependency: | ||
[35mpeer[39m [1meslint[22m@"[1m^6.0.0[22m" from [1meslint-plugin-jsdoc[22m@[1m22.2.0[22m[2m[22m | ||
[2mnode_modules/eslint-plugin-jsdoc[22m | ||
[33mdev[39m [1meslint-plugin-jsdoc[22m@"[1m^22.1.0[22m" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP no current node, no current edge, idk > report with no color, depth of 6 1`] = ` | ||
While resolving: [email protected] | ||
Could not resolve dependency: | ||
peer eslint@"^6.0.0" from [email protected] | ||
node_modules/eslint-plugin-jsdoc | ||
dev eslint-plugin-jsdoc@"^22.1.0" from the root project | ||
Fix the upstream dependency conflict, or retry | ||
this command with --force, or --legacy-peer-deps | ||
to accept an incorrect (and potentially broken) dependency resolution. | ||
See \${REPORT} for a full report. | ||
` | ||
|
||
exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > explain with color 1`] = ` | ||
While resolving: [1m@isaacs/peer-dep-cycle-b[22m@[1m1.0.0[22m | ||
Found: [1m@isaacs/peer-dep-cycle-c[22m@[1m2.0.0[22m[2m[22m | ||
|
Oops, something went wrong.