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

后端 未结 5 1202
陌清茗
陌清茗 2020-12-12 12:44

I\'ve installed Node.js on my Windows 7 x64 development machine, the manual way:

mkdir C:\\Devel\\nodejs
cd C:\\De         


        
5条回答
  •  鱼传尺愫
    2020-12-12 13:24

    You can also set an environment variable with export npm_config_cache=/path/to/cache (Unix) or set npm_config_cache=C:\path\to\cache (Win) as an alternative to npm config set (this is true for all config options in npm).


    For anyone using docker you can add the env var at runtime with:

    docker run -e npm_config_cache=/path/to/cache mydockerimage:tag
    

提交回复
热议问题