尝试使用 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/