I have repo in git and trying to build with yaml in vsts. In repository there is only newly created angular project without any changes. When trying to run pipeline with default angular yaml i get following error when running "ng build --prod"
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
ng build --prod
displayName: 'npm install and build'
# Publish Artifacts
- task: PublishBuildArtifacts@1
inputs:
artifactName: dist
pathtoPublish: 'dist'
OK I found the answer. I needed to add:
workingDirectory: '$(Build.SourcesDirectory)/projectFolderName'
below:
displayName: 'npm install and build'
You would need a file package.json at the specified location under
workingDirectory: '$(Build.SourcesDirectory)/<path_to_file_packages.json>'
The json file could be consisting of
{
"scripts":{
"build":"node node_modules/@microsoft/azure-data-factory-utilities/lib/index"
},
"dependencies":{
"@microsoft/azure-data-factory-utilities":"^0.1.6"
}
}
The latest version of Azure Data Factory Utilities should match the version number here https://www.npmjs.com/package/@microsoft/azure-data-factory-utilities
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With