How to print a list of all installed Node.js modules?

Sometimes, we want to print a list of all installed Node.js modules.

In this article, we’ll look at how to print a list of all installed Node.js modules.

How to print a list of all installed Node.js modules?

To print a list of all installed Node.js modules, we can use npm ls.

For instance, we run

npm -g ls --depth=0

to print all the installed global packages.

And we run

npm ls --depth=0

to print all the installed local packages in a folder.

Conclusion

To print a list of all installed Node.js modules, we can use npm ls.