List globally installed Node.js packages on your machine

To list globally installed Node.js packages on your machine you can run the following command:

ls `npm root -g`

and it will just list globally installed packages, like for example:

drwxr-xr-x   19 nikola  staff   646 May  3 21:07 bower
drwxr-xr-x   29 nikola  staff   986 May 20 20:59 casperjs
drwxr-xr-x    9 nikola  staff   306 Feb 27  2015 compass
drwxr-xr-x   16 nikola  staff   544 Feb  6  2015 cordova
drwxr-xr-x    9 nikola  staff   306 May  1 16:50 express
drwxr-xr-x    8 nikola  staff   272 May  1 16:48 express-generator
drwxr-xr-x   12 nikola  staff   408 Dec 15  2014 forever
drwxr-xr-x   23 nikola  staff   782 Feb 27  2015 generator-angular
drwxr-xr-x    6 nikola  staff   204 Feb 27  2015 generator-gulp-angular

If, however, you use the following command:

npm list --global

it will give you the full list of other dependencies in a tree list, like for example:

├─┬ [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └─┬ [email protected]
│   │   ├── [email protected]
│   │   └── [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]

Written by Nikola Brežnjak