← 返回命令列表

Linux command

npm-ls 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List installed packages

npm ls

List all depths

npm ls --all

List specific package

npm ls [package-name]

List global packages

npm ls -g

JSON output

npm ls --json

Production only

npm ls --production

Show depth

npm ls --depth=[2]

说明

npm ls lists installed packages. Shows dependency tree. The command displays package hierarchy. Identifies dependency versions.

参数

--all
Show all dependencies.
-g
Global packages.
--json
JSON output.
--depth _N_
Tree depth.
--help
Display help information.

FAQ

What is the npm-ls command used for?

npm ls lists installed packages. Shows dependency tree. The command displays package hierarchy. Identifies dependency versions.

How do I run a basic npm-ls example?

Run `npm ls` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --all do in npm-ls?

Show all dependencies.