首页 > 解决方案 > 如何自动化 NodeJS/npm 依赖更新?

问题描述

我正在维护一些大型 NodeJS 应用程序(微服务、应用程序),它们消耗许多(至少 100 多个)依赖项。更新这些依赖项以修复安全漏洞迫使我花费宝贵的开发时间。

有没有办法跨存储库自动更新包?
We're using GitLab for SCM.

我曾想过一些选择,例如:

  1. Separating out core dependencies into a base level library.
  2. Maintain a repository that specifies security-cleared dependency versions and repositories to be updated whenever the cleared list changes.

任何其他建议/示例?

标签: node.jsnpmcontinuous-integrationgitlabbuild-automation

解决方案


只是为了帮助列出问题中提到的入围方法:

1. Separating core dependencies into a "Core" library.

  • 这可以减少更新次数。但是基于“Core”的库仍然有自己的依赖,可能容易出现漏洞,必须手动重复更新周期。这种方法只会拖延手动更新。

2. Maintain a repository that specifies security-cleared dependency versions and repositories to be updated whenever the cleared list changes.


推荐阅读