07-21-2023, 03:01 PM
This is a simple question and should have a simpler answer than what I see in previous answers.
To see the installed npm packages with their version, the command is `npm ls --depth=0`, which, by default, displays what is installed locally. To see the globally installed packages, add the `-global` argument: `npm ls --depth=0 -global`.
`--depth=0` returns a list of installed packages without their dependencies, which is what you're wanting to do most of the time.
`ls` is the name of the command, and `list` [is an alias][1] for `ls`.
[1]:
To see the installed npm packages with their version, the command is `npm ls --depth=0`, which, by default, displays what is installed locally. To see the globally installed packages, add the `-global` argument: `npm ls --depth=0 -global`.
`--depth=0` returns a list of installed packages without their dependencies, which is what you're wanting to do most of the time.
`ls` is the name of the command, and `list` [is an alias][1] for `ls`.
[1]:
[To see links please register here]