
To show all globally installed npm packages on your computer, just run the following command:
npm list -g --depth 0
Here is my output:
/usr/local/lib
├── @nestjs/cli@8.1.6
├── corepack@0.10.0
├── create-next-app@12.0.8
├── cross-env@7.0.3
├── expo-cli@5.0.3
├── firebase-tools@9.12.1
├── i@0.3.7
├── live-server@1.2.1
├── node-gyp@8.1.0
├── nodemon@2.0.7
├── npm@8.3.0
├── ts-node@10.2.1
├── typescript@4.3.5
└── yarn@1.22.10
If you want to see all global packages and their dependencies, use this:
npm list -g
That’s it. Further reading:
- Node.js: How to Compress a File using Gzip format
- Node.js: The Maximum Size Allowed for Strings/Buffers
- 4 Ways to Read JSON Files in Node.js
- Node.js: Using __dirname and __filename with ES Modules
- Tweaking a Node.js Core Module
You can also check out our Node.js category page for the latest tutorials and examples.