To change the cache path for npm (or completely disable the cache) on Windows, we run the config set cache
command.
For instance, we run
> npm config set cache C:\dev\nodejs\npm-cache --global
to set the cache directory to the C:\dev\nodejs\npm-cache folder.
We then run
npm --global cache verify
to verify the cache directory is set.