-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'npm explain' command #1776
Conversation
Reduce visual noise, make the more important information more obvious.
f5196e3
to
dbd5ea9
Compare
Could there be colors added for supporting terminals? it might help the readability of what is otherwise a large block of text |
also is there a way it could be a table instead, with the |
dbd5ea9
to
135cb23
Compare
Yes, there are colors.
The challenge there is that the indentation can get pretty deep, and so putting too much horizontally can be a problem, especially when these node explanations appear in error logs for |
Oops forgot to push the rebase to remove all those debug commits. Should have this ready to land shortly. |
e41fe4f
to
ffe16b0
Compare
Pass a specifier or folder path, and it'll explain what that dependency is doing there.
ffe16b0
to
a947bc0
Compare
Ok, this is now ready for review. |
Pass a specifier or folder path, and it'll explain what that dependency is doing there. PR-URL: #1776 Credit: @isaacs Close: #1776 Reviewed-by: @ruyadorno
Landed 5e49bda |
Took the code used to explain ERESOLVE errors, and just made it a top-level command that will explain a given set of nodes.
This is surprisingly handy! Like, if you noticed that
react
is in thenode_modules
tree, you could do this:Or if you want to know why
mkdirp
is being duplicated, you could run:Definitely some overlap in use-cases with
npm ls
, but coming at the data in the other direction, starting with the dependency as the top of the "tree" and then showing each dependent tracking back to the root project, which makes it a better fit for the "why is this here??" questions.cc: @ljharb I think I promised you this when we were discussing removing the
_
-prefixed fields frompackage.json
files innode_modules
.