Reputation: 4169
I have multiple Node.js versions on my computer, and i'm using n to switch back and forth between versions. When i'm using version 4.0 which is the first version that I've installed i can use the following command to list all the globally installed node modules :
npm list -g --depth=0
Whereas when using 5.x versions like (5.0.0 or 5.2.0) i get a an empty string, meaning that there is no global modules.
I've also tried to get the path to global modules under version 4.0.0 and higher using the following command :
npm root -g
and surprisingly it was the same path.
What i can't grasp here is how can it come that they share the same path and i'm getting different results in different versions.
Any suggestion is appreciated.
Upvotes: 0
Views: 68
Reputation: 12037
This a bug in npm
version 3.5.3 which comes with node
5.x. You can read more about it here: npm can't list global packages
You can view all the installed packages by executing ls
on the root directory.
Upvotes: 1