diff --git a/azDevOps/azure/templates/v2/steps/build-install-dependencies-node.yml b/azDevOps/azure/templates/v2/steps/build-install-dependencies-node.yml index 3e52c365..1452353b 100644 --- a/azDevOps/azure/templates/v2/steps/build-install-dependencies-node.yml +++ b/azDevOps/azure/templates/v2/steps/build-install-dependencies-node.yml @@ -11,7 +11,7 @@ parameters: customRegistry: "" run_build: true enable_cache: false - npm_config_cache: $(Pipeline.Workspace)/.npm + npm_cache_directory: "" steps: # Ensure Node.js 12 is active @@ -33,18 +33,14 @@ steps: # NPM modules and Cypress binary should be cached # otherwise the install will be too slow # https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops - # since the username / user home directory are not available via system variables - # (there is even an open question about it) - # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops - # just use "/home/vsts_azpcontainer/" for now - task: Cache@2 condition: eq(${{ parameters.enable_cache }}, true) inputs: key: 'npm | $(Agent.OS) | ${{ parameters.workingDirectory }}/package-lock.json' - path: $(npm_config_cache) restoreKeys: | npm | $(Agent.OS) npm + path: ${{ parameters.npm_cache_directory }} cacheHitVar: NPM_CACHE_RESTORED displayName: Cache NPM packages