How can I get the path to the global npm_modules within javascript?
From command line, I can get the base path to the npm modules by calling this:
npm config get prefix
How, can I get this path within a javascript file? Is there some module I can use to get this path?
I am trying to configure my protractor.config.js file to specify the paths for seleniumServerJar and chromeDriver, (which are installed globally), and I need to know the path to the global npm modules so I can specify these paths.
There is an environment variable NODE_PATH which is how node finds its node_modules dir
console.log(process.env.NODE_PATH);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With