当使用npmcaching,为什么?

我什么时候必须使用npm cache clean ? 而且,为什么在使用npm cache clean ,我是否info trying获取info trying

 info trying registry request attempt 1 at 09:54:07 http GET https://registry.npmjs.org/delayed-stream/latest http 304 https://registry.npmjs.org/delayed-stream/latest 

Npm将包caching到目录(Linux / OS X上的~/.npm和Windows上的%AppData%/npm-cache )。

这有助于当您有多个基于nodejs的设置需要各种包作为依赖。 Npm不会下载已经存在于caching中的软件包,而是在已经存在的情况下使用caching中的软件包。 因此,在这种情况下,它会尝试优化下载次数。

现在,关于你什么时候使用npm cache clean 。 我使用它时,由于某种原因,我的caching损坏与不同的依赖关系的一些冲突版本,或者你只是想清理你知道你根本不需要的软件包,就像某些依赖项的老版本。

基本上,在使用npm cache clean ,就像重新安装nodejs / npm一样,除了全局安装的节点模块之外(直到你用npm uninstall命令删除它们)。

其他信息: https : //www.npmjs.org/doc/cli/npm-cache.html#CONFIGURATION