Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript npm Basics (retiring) Updating and Uninstalling Packages with npm Uninstalling Packages with npm

How can we view a list of all global dependencies installed?

Since we can't see these in our folder structure, is there a command to see which are installed in a list format?

1 Answer

I answered my own question with a little google search. You can use npm list -g --depth=0

You can change the depth to any number desired. Using --depth=0 will show only the main dependency.

Additionally, by removing -g it will show all of the depencies that are local, but not the global dependencies.

I hope this helps for anyone with the same question. If there is a moderator, or anyone with more knowledge on this topic, please feel free to add to this post, in case I've missed any important info.