node.js - 有什么建议可以缩短 teamcity 中 npm 的安装时间

标签 node.js npm continuous-integration teamcity

尝试使用 teamcity 构建和部署 ionic 程序。但每次 teamcity 都需要安装所有 npm 模块。

我尝试使用powershell备份node_modules文件夹,但teamsity不允许在powershell中使用remove-item或move-item,并且我有4-5个代理在teamcity中构建项目,所以我认为在本地存储不是更好的方法。

任何人都有减少时间的最佳解决方案。

最佳答案

有时您无法避免运行 npm install,但您可以显着加快速度。

一个可能的解决方案是使用 npm 缓存:

但这并不总是能够有效使用。

另一种选择是使用 npm 代理:

或者:

sinopia - a private/caching npm repository server. It allows you to have a local npm registry with zero configuration. You don't have to install and replicate an entire CouchDB database. Sinopia keeps its own small database and, if a package doesn't exist there, it asks npmjs.org for it keeping only those packages you use.

一些很好的教程可能会有所帮助:

关于node.js - 有什么建议可以缩短 teamcity 中 npm 的安装时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42919784/

相关文章:

continuous-integration - 推送标签时未触发 GitHub 操作

node.js - 使用数据填充 TingoDB 以进行验收测试

node.js - 使用 Azure 移动服务计划任务访问 Azure 服务管理 REST Api

node.js - 当我尝试在终端中执行 npm run dev 命令时出现 Npm 错误

angular - 使用 Angular 从谷歌和Facebook注销

jenkins - 如果下游作业失败,如何向上游提交者发送电子邮件?

node.js - 如何调试我的 Bower 可插拔解析器?

node.js - 如何在 Node.js 中使用 Socket.io 从客户端发送到路由文件

node.js - 如何从名称中包含 @ 的 NPM 包安装 @types

使用 Maven 将 Java 应用程序部署到 heroku 失败