How to get the global module installation folder in Node.js

Viewed 28346

I'm trying to access the location on the disk of the global node modules (from within a node module).

I know I can enter npm root -g on the command line, but this is awfully SLOW.

Does any of you know a way to get this information reliably and in a timely fashion (without requiring users to setup any global Env variables)?

2 Answers

On Windows, It can be done by executing the command : where npm

Related