Moving npm-cache from C drive to D drive (on Windows)

Commands 

Get cache path: npm config get cache
Output: C:\Users\Ravi-user\AppData\Local\npm-cache

Clear cache: npm cache clean
Asks for --force to be used to delete cache. I used that. It reduced cache directory size (on C drive) from over 1 GB to 17.6 MB!

Set cache path: npm config set cache=D:\Users\Ravi-user\AppData\Local\npm-cache
No output but immediately after running: npm config get cache
gave output: D:\Users\Ravi-user\AppData\Local\npm-cache
So it seems to have done the job of changing the config info. for npm cache location.

Need to see whether npm now works properly and uses this cache.
Testing npm by copying src data of working React program -node-modules to temp directory and then running npm install in temp directory. The program's running slowly but is populating the new directory location (D drive) cache. It completed successfully. Then I could run the React program by using: npm start.

So I seem to have successfully cleaned npm-cache from C drive and moved it to D drive. This has freed up significant amount of disk space in C drive.
==========

Comments

Archive