cli
cli copied to clipboard
[BUG] Aliased packages ignored by `npm list`
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
npm list [pkg]
list only packages that have name = pkg
but not packages with alias = pkg
Example:
$ npm list uuid
[email protected] /path/to/my/project
├─┬ @vue/[email protected]
│ └─┬ @vue/[email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @vue/[email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @vue/[email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]
Expected Behavior
I would expect the command to also list installations of the package with name = pkg
where alias != pkg
, indicating, it has been aliased on the entry of the package tree.
Example:
$ npm list uuid
[email protected] /path/to/my/project
├─┬ @vue/[email protected]
│ └─┬ @vue/[email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @vue/[email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @vue/[email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└── [email protected] as uuid8
Notice the last line (new):
└── [email protected] as uuid8
*the part as uuid8
indicates the alias and is only a suggestion, it might look completely different.
Steps To Reproduce
- Create VUE-CLI project
- Install the
uuid
package with alias (npm install uuid8@npm:uuid@8
) - Run
npm list uuid
- => The version 8 installation of
uuid
is not showing up
Environment
- OS: Linux 5.4.0-81 (Regolit/Ubuntu)
- Node: 14.17.6
- npm: 7.24.2
Me too, and what's the plan to this issue?