简体   繁体   English

npm-cache已包含100个软件包

[英]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.

相关问题 在Windows中删除npm-cache文件夹是否安全? - Is it safe to remove npm-cache folder in windows? 在 npm-cache 目录中,除了 _cacache 之外的文件夹是干什么用的? - In npm-cache directory, what are the folders other than _cacache for? 如何检查NPM缓存是否已包含tarball - How to check if NPM cache already contains a tarball npm缓存包吗? - Does npm cache packages? azure 应用服务安装错误:EACCES:权限被拒绝,mkdir '/opt/Kudu/local/npm-cache' - azure app service Installation error: EACCES: permission denied, mkdir '/opt/Kudu/local/npm-cache' 如何取消设置此命令“npm config set cache”C:/Users/ASIMIM/AppData/Roaming/npm-cache“--global” - How can I unset this command “npm config set cache ”C:/Users/ASIMIM/AppData/Roaming/npm-cache“ --global” npm 错误。 代码 ENOLOCAL npm 错误! 无法从“Ibrahi\AppData\Roaming\npm-cache\_npx\8992”安装,因为它不包含 package.json 文件 - npm ERR! code ENOLOCAL npm ERR! Could not install from "Ibrahi\AppData\Roaming\npm-cache\_npx\8992" as it does not contain a package.json file 在 Docker GitHub 动作中缓存 npm 包 - Cache npm packages in Docker GitHub actions npx create-react-app myapp 错误“\AppData\Roaming\npm-cache\_npx\19748”在 appdata 文件夹中不包含 package.json 文件 - npx create-react-app myapp error "\AppData\Roaming\npm-cache\_npx\19748" does not contain a package.json file in appdata folder npm缓存清理v / s npm缓存验证 - npm cache clean v/s npm cache verify
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM