The npm list command provides an overview of the installed npm packages in your current project. The output can be extensive, especially if your project has many dependencies.
List Globally Installed Packages
To list npm user-installed packages globally in Node.js, you can use the “npm list -g –depth=0” command.
Here:
- -g stands for “global”. It tells npm to list globally installed packages.
- –depth=0 ensures you only see the top-level packages, not their dependencies.
List Locally Installed Packages
To list the packages you have installed locally (current project), navigate to the project’s directory and use the “npm list –depth=0” command.
Here:
- –depth=0 ensures you only see the top-level packages, not their dependencies.
Outdated Packages
To check which of your installed packages are outdated (either globally or locally), you can use:
npm outdated -g # For globally installed packages
OR
npm outdated # For locally installed packages
You can see the output shows you the current version you have, the latest version available, and the version that your package.json file (if you have one) wants you to have.
That’s it!

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.