1 ---
2 title: npm-ls
3 section: 1
4 description: List installed packages
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-ls.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/ls
10 - /cli-documentation/v6/cli-commands/npm-ls
11 - /cli-documentation/v6/commands/ls
12 - /cli-documentation/v6/commands/npm-ls
13 - /cli-documentation/v6/ls
14 - /cli-documentation/v6/npm-ls
15 - /cli/v6/cli-commands/ls
16 - /cli/v6/cli-commands/npm-ls
17 - /cli/v6/commands/ls
18 - /cli/v6/ls
19 - /cli/v6/npm-ls
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm ls [[<@scope>/]<pkg> ...]
26
27 aliases: list, la, ll
28 ```
29
30 ### Description
31
32 This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
33
34 Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
35
36 ```bash
37 npm@6.14.18 /path/to/npm
38 └─┬ init-package-json@0.0.4
39 └── promzard@0.1.5
40 ```
41
42 It will print out extraneous, missing, and invalid packages.
43
44 If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project.
45
46 The tree shown is the logical dependency tree, based on package dependencies, not the physical layout of your node_modules folder.
47
48 When run as `ll` or `la`, it shows extended information by default.
49
50 ### Configuration
51
52 #### json
53
54 - Default: false
55 - Type: Boolean
56
57 Show information in JSON format.
58
59 #### long
60
61 - Default: false
62 - Type: Boolean
63
64 Show extended information.
65
66 #### parseable
67
68 - Default: false
69 - Type: Boolean
70
71 Show parseable output instead of tree view.
72
73 #### global
74
75 - Default: false
76 - Type: Boolean
77
78 List packages in the global install prefix instead of in the current project.
79
80 #### depth
81
82 - Type: Int
83
84 Max display depth of the dependency tree.
85
86 #### prod / production
87
88 - Type: Boolean
89 - Default: false
90
91 Display only the dependency tree for packages in `dependencies`.
92
93 #### dev / development
94
95 - Type: Boolean
96 - Default: false
97
98 Display only the dependency tree for packages in `devDependencies`.
99
100 #### only
101
102 - Type: String
103
104 When "dev" or "development", is an alias to `dev`.
105
106 When "prod" or "production", is an alias to `production`.
107
108 #### link
109
110 - Type: Boolean
111 - Default: false
112
113 Display only dependencies which are linked
114
115 #### unicode
116
117 - Type: Boolean
118 - Default: true
119
120 Whether to represent the tree structure using unicode characters. Set it to false in order to use all-ansi output.
121
122 ### See Also
123
124 - [npm config](/cli/v6/commands/npm-config)
125 - [npmrc](/cli/v6/configuring-npm/npmrc)
126 - [npm folders](/cli/v6/configuring-npm/folders)
127 - [npm install](/cli/v6/commands/npm-install)
128 - [npm link](/cli/v6/commands/npm-link)
129 - [npm prune](/cli/v6/commands/npm-prune)
130 - [npm outdated](/cli/v6/commands/npm-outdated)
131 - [npm update](/cli/v6/commands/npm-update)