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