Azure CI管道Angular应用程序构建失败

时间:2020-02-10 12:25:57

标签: angular azure-devops continuous-integration

我已经花了很多时间来寻找解决方案,并且已经进行了72次运行,但是对我来说并不起作用。我正在使用Azure devops管道。这是日志。为什么要删除目录?可能是问题所在吗?

##[debug]customRegistry=useNpmrc
##[debug]Using registries in .npmrc
##[debug]customEndpoint=null
##[debug]customRegistry=useNpmrc
##[debug]which 'npm'
##[debug]found: 'C:\hostedtoolcache\windows\node\6.17.1\x64\npm.cmd'
##[debug]which 'npm'
##[debug]found: 'C:\hostedtoolcache\windows\node\6.17.1\x64\npm.cmd'
##[debug]System.Debug=true
##[debug]Agent.BuildDirectory=D:\a\1
##[debug]rm -rf D:\a\1\npm
##[debug]removing directory
##[debug]task result: Failed
##[error]Error: Please change your working directory to a valid directory
##[debug]Processed: ##vso[task.issue type=error;]Error: Please change your working directory to a valid directory
##[debug]Processed: ##vso[task.complete result=Failed;]Error: Please change your working directory to a valid directory

YAML

pool:
  name: Azure Pipelines
steps:
- task: NodeTool@0
  displayName: 'Use Node 6.x'

- task: Npm@1
  displayName: 'Use npm @latest'
  inputs:
    command: custom
    verbose: false
    customCommand: 'install -g npm@latest'

- task: Npm@1
  displayName: 'npm install'
  inputs:
    verbose: false

- task: Npm@0
  displayName: 'npm build'
  inputs:
    cwd: myapp/package.json
    command: custom
    arguments: 'run prod-build-dev'

- task: CopyFiles@2
  displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
  inputs:
    SourceFolder: '$(agent.builddirectory)'
    TargetFolder: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: app'
  inputs:
    ArtifactName: app

0 个答案:

没有答案