Categories
JavaScript Answers

How to change the cache path for npm (or completely disable the cache) on Windows?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *