Step 1:
npm config get prefix
- Default Path is :
%USERPROFILE%\AppData\Roaming\npm
Step 2:
npm config get cache
- Default Path is :
%USERPROFILE%\AppData\Roaming\npm-cache
Step 3:
npm config set prefix \npm
- example
npm config set prefix C:\\dev\\node\\npm
Step 4:
npm config set cache \npm-cache
- example
npm config set cache C:\\dev\\node\\npm-cache
Run steps 1 & 2 again to check whether the paths are updated as required
That's it. Whenever you install global packages you should see them installed inside \npm\node_modules