change npm install path for global packages to a custom directory
<p>I want to configure my node setup such that it stores global modules (installed using <code>npm install -g &lt;pkg&gt;</code> to (and also reads from) a custom directory <code>D:\node_modules</code>. default path is <code>C:\Users\User\AppData\Roaming\npm</code> . Any pointers would be much appreciated. </p>

<p>OS is Windows.</p>