[英]npm-cache contains 100's of packages already
I installed node.js and npm on a new Windows 7 machine recently using the msi installer. 我最近使用msi安装程序在新的Windows 7计算机上安装了node.js和npm。 When i looked in my users//appdata/roaming/npm-cache directory, it looked as if a cached copy of 150 packages was already there. 当我查看我的users // appdata / roaming / npm-cache目录时,看起来好像已经有150个软件包的缓存副本。
My question is, how did those get there? 我的问题是,这些人如何到达那里? I thought that the msi installer had done it but now I don't think so. 我以为msi安装程序已经完成了,但是现在我不这么认为。
It would be useful to know since I don't always have a network connection, and to be able to install from the cache would be helpful. 知道这一点将很有用,因为我并不总是具有网络连接,并且能够从缓存进行安装将很有帮助。
Basically, I would like to know if it's possible to just cache a bunch (if not all) current npm packages using one command. 基本上,我想知道是否可以使用一个命令仅缓存一堆(如果不是全部)当前的npm软件包。 I know for a fact that I didn't cache all 150 of these packages myself, maybe I did a dozen tops. 对于一个事实,我知道自己并没有缓存所有150个软件包,也许我做了十几个。
@apsillers and @generalhenry are correct. @apsillers和@generalhenry是正确的。
It appears that npm flattens all sub-dependencies into the npm-cache directory. 看来npm将所有子依赖关系展平到npm-cache目录中。
I verified this by deleting the npm-cache/jshint folder, and then doing npm install on a project that contained the grunt-contrib-jshint project, and jshint was majically re-added to the npm-cache directory. 我通过删除npm-cache / jshint文件夹验证了这一点,然后在包含grunt-contrib-jshint项目的项目上进行了npm install,然后jshint被重新添加到npm-cache目录中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.