node.js - npm 不使用缓存

标签 node.js caching jenkins

警告,我正在从用作 Jenkins 构建从属的 Docker 容器中运行 npm install,但我已经确定 npm 缓存未损坏并且存储在持久卷中跨容器运行和 rms,您可以看到 that proof here

当我运行 npm cache ls 时,会列出 package.config 中的许多包: enter image description here

然而,每次我运行 npm installnpm --skip-installed --cache-min 9999999 install 时,每个软件包都会被安装。

  • 环境是 Centos7 docker 容器
  • Node --版本 6.11.4
  • npm --版本 3.10.10

当我在本地 Windows 10 计算机上运行 npm install 两次( Node 版本和 npm 版本相同)时,第二次运行 npm install 时显然使用了缓存: enter image description here

最佳答案

我能够在这里解决在 Docker 容器中缓存 NPM 包的问题: https://devops.stackexchange.com/a/2936/4790

关于node.js - npm 不使用缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46963456/

相关文章:

node.js - 对于 Node/Mongo/NginX,哪种缓存方法最快/最轻?

javascript - 简单的 JavaScript 代码不适用于 Node.js

node.js - git 添加 . Node.js 的命令不起作用

node.js - 无限循环: Cannot find 'cross-spawn'

javascript - 如何删除AngularJS中的缓存?

ubuntu - 无法访问 Jenkins 且没有日志

javascript - 从 Swift 4 向 Node.js 发送发布请求

php - 是什么导致 PHP 中出现 "Unable to allocate memory for pool"?

amazon-web-services - 通过 jenkins 部署到 AWS 时出现 Terraform 版本错误?

java - 无法替换批处理文件中的参数值 - PostBuildScript 插件 Jenkins