Disable npm cache

后端 未结 3 677
深忆病人
深忆病人 2021-02-12 20:11

Some time ago I had trouble with the npm cache on our build machines. From time to time we had to do npm cache clean by hand, and that solved various issues that we

3条回答
  •  情话喂你
    2021-02-12 20:35

    You could fix the problem with parallel builds by creating a new directory for one series of npm commands and set its cache to that empty directory and then remove that directory afterwards. Like:

    export npm_config_cache=$(mktemp -d) 
    npm ...
    ...
    rm -rf $npm_config_cache
    

    This would remove the need for npm cache clean as it would always start out with an empty cache.

提交回复
热议问题