Get a List of Globally Installed NPM packages on Your Machine
How can you get a list of all the globally installed NPM packages on your machine?
Open a terminal window and execute this command:
npm list -g --depth 0
This will output a list of all your globally installed NPM packages with their version number:
├── email@example.com ├── firstname.lastname@example.org ├── email@example.com └── firstname.lastname@example.org
Here's a breakdown of each part of the command:
list -g: tells NPM to only list global packages.
--depth 0: tells NPM to only return parent packages without a list of their dependencies.
Thanks for reading and happy coding!