npm config set cache ~/.npm-cache

Category: Node.js & npm/yarn

npm config set cache ~/.npm-cache

Set a custom directory where npm stores its download cache

Sets the folder where npm stores downloaded package tarballs. Pointing this to a faster or larger drive can speed up repeated installs.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.