首页 > 解决方案 > 在 Azure Devops 中使用缓存任务

问题描述

我在 Azure Devops 构建管道中使用缓存任务,因为我想缓存我的 NPM 包,这样就不必在每次运行构建时都下载它们。

在此处输入图像描述

要缓存我的解决方案的 node_modules 文件夹,我应该在路径输入中使用$(System.DefaultWorkingDirectory)/node_modules还是只使用 node_modules ?

标签: npmazure-devopsnode-modules

解决方案


如果你想缓存 npm 的node_modules,那么 path 的值应该是$(Pipeline.Workspace)/.npm/lib/node_modules.

您可以单击此文档以获取详细信息。


推荐阅读