0

We are using Azure DevOps pipeline to build Azure Data Factory (ADF) ARM template. I have followed same process as per below Microsoft Documentation.

https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-improvements

In order to build this we need to install npm package as below.

{
    "scripts":{
        "build":"node node_modules/@microsoft/azure-data-factory-utilities/lib/index"
    },
    "dependencies":{
        "@microsoft/azure-data-factory-utilities":"^0.1.5"
    }
}

This worked fine till last week. But recently we are facing some issues with this package build script. Attached error log details below.

2022-06-17T04:43:36.0199947Z 17 verbose argv "C:\\hostedtoolcache\\windows\\node\\10.24.1\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\10.24.1\\x64\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "validate" "D:\\a\\1\\s/datafactory" "/subscriptions/****/resourceGroups/****/providers/Microsoft.DataFactory/factories/***"
2022-06-17T04:43:36.0200926Z 18 verbose node v10.24.1
2022-06-17T04:43:36.0201275Z 19 verbose npm  v6.14.12
2022-06-17T04:43:36.0201637Z 20 error code ELIFECYCLE
2022-06-17T04:43:36.0201982Z 21 error errno 1
2022-06-17T04:43:36.0202813Z 22 error @ build: `node node_modules/@microsoft/azure-data-factory-utilities/lib/index "validate" "D:\a\1\s/datafactory" "/subscriptions/***/resourceGroups/***/providers/Microsoft.DataFactory/factories/***"`
2022-06-17T04:43:36.0203638Z 22 error Exit status 1
2022-06-17T04:43:36.0204001Z 23 error Failed at the @ build script.
2022-06-17T04:43:36.0204500Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2022-06-17T04:43:36.0204983Z 24 verbose exit [ 1, true ]
2022-06-17T04:43:36.0205199Z 
2022-06-17T04:43:36.0272225Z ##[error]Error: Npm failed with return code: 1
2022-06-17T04:43:36.0335788Z ##[section]Finishing: Validate

Could someone help me to fix this issue?

Nihar KN
  • 51
  • 1
  • 5

1 Answers1

0

This problem can be fixed by updating your Install module.js file.

# Installs Node and the npm packages saved in your package.json file in the build

- task: NodeTool@0
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'
- task: Npm@1
  inputs:
    command: 'install'
    workingDir: '$(Build.Repository.LocalPath)/<folder-of-the-package.json-file>' #replace with the package.json folder
    verbose: true
  displayName: 'Install npm package'  

you can get these code from your documentation

Reference:

  1. SO thread
Venkatesan
  • 3,748
  • 1
  • 3
  • 15