Hello everyone i'm new with azure devops CI and i'm trying to reduice my pipeline build time by caching node_modules between jobs ,but i got this error that i can't resolve. i'm using cypress for testing. Here is my azure pipeline
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'windows-2019'
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Cache@2
inputs:
key: 'npm | “$(Agent.OS)” | $(Build.SourcesDirectory)/package-lock.json'
path: '$(Build.SourcesDirectory)/node_modules'
cacheHitVar: 'CacheRestored'
- script: npm install
displayName: 'npm install '
condition: ne(variables['CacheRestored'], 'true')
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run scripts'
continueOnError: false
displayName: 'Npm run test'
- task: PublishBuildArtifacts@1
displayName: "Publish Artifact: cypress-and-azure-devops Screenshots"
inputs:
PathtoPublish: cypress/screenshots
ArtifactName: CypressAndAzureDevopsTestRunScreenshots
condition: failed()
- task: PublishBuildArtifacts@1
displayName: "Publish Artifact: cypress-and-azure-devops Videos "
inputs:
PathtoPublish: cypress/videos
ArtifactName: CypressAndAzureDevopsTestRunVideos
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: "Publish Test Results"
condition: succeededOrFailed()
inputs:
testResultsFormat: "JUnit"
testResultsFiles: "**/cypress-and-azure-devops-*.xml"
failTaskOnFailedTests: true