在NPM软件包中面对构建脚本的问题

发布于 2025-02-08 07:18:04 字数 1922 浏览 3 评论 0 原文

我们正在使用Azure DevOps管道来构建Azure数据工厂(ADF)ARM模板。我遵循了与Microsoft文档以下文档相同的过程。

为了构建此功能,我们需要按照以下安装NPM软件包。

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

直到上周,这都很好。但是最近,我们在此软件包构建脚本上面临一些问题。下面附带的错误日志详细信息。

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

有人可以帮我解决这个问题吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

私野 2025-02-15 07:18:04

可以通过更新您的 install module.js 文件来解决此问题。

# 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'  

您可以从文档

  1. > “ https://stackoverflow.com/questions/42308879/how-to-solve-npm-eror-npm-eror-npm-err-code-elifecycle"> shore

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文