How to list all globally installed NPM packages

Below is the npm command to view globally installed NPM packages. If you want to view current directory’s packages just execute the same command without the -g option.

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:

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.