Last updated on November 21, 2022
Below is the npm command to view globally installed NPM packages. If you want to view the current directory’s packages just execute the same command without the -g
option.
$ npm list -g --depth=0
list -g: display a tree of every package found in the user’s folders
depth 0 / depth=0: avoid including every package’s dependencies in the tree view, in other words, max display depth of the dependency tree
The result will look something like this:
arjun@arjun-PC MINGW64 ~
$ npm list -g --depth=0
C:\Users\arjun\AppData\Roaming\npm
+-- @angular/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]