You can list what packages are installed globally in your system with npm -g list
—shorthand for npm --global list
—whereas you'd list the packages installed in an NPM project with npm list
.
Let's see an example of what the command might return.
npm -g list
# /opt/homebrew/lib
# ├── cross-env@7.0.3
# ├── http-server@14.1.1
# ├── node-gyp@9.3.1
# ├── npm@9.5.0
# ├── pm2@5.2.2
# ├── spoof@2.0.4
# ├── ts-node@10.9.1
# └── typescript@4.9.5