【问题标题】:Azure devops failing to download private npm packagesAzure devops 无法下载私有 npm 包
【发布时间】:2020-10-19 17:06:54
【问题描述】:

我将 Azure DevOps 用于我的节点应用程序,但我有私有 npm 包,每当 DevOps 在管道期间运行 npm install 时,这些包都会失​​败并显示 401。我已经运行了额外的 npm 任务运行程序,用于验证注册表 URL 设置为 https://npm.pkg.github.com/ 的位置以及 npm 帐户的用户名和密码。最后,我在包含@[organisation_name_here]:registry=https://npm.pkg.github.com/ 的项目中本地创建了一个.npmrc 文件。但是,当我仍然运行管道时,我仍然收到以下错误:

npm ERR! 401 Unauthorized: @***/schemas@^1.0.8

我已经看到并阅读了有关使用 Azure Artifacts 的能力,但是,我不想避免使用它们,因为我正在慢慢迁移到 AWS。如果 Azure Artifacts 是唯一的方法,那么请帮忙!我要慢慢发疯了XD lol

谢谢:)

【问题讨论】:

    标签: azure npm azure-devops


    【解决方案1】:

    如果您的 .npmrc 包含来自不同组织的 Azure Artifacts 注册表或使用第三方经过身份验证的包存储库,则需要设置 npm service connections 并在 customEndpoint 输入中指定它们。

    registry=https://pkgs.dev.azure.com/{organization}/{project}/_packaging/{feed}/npm/registry/
    @{scope}:registry=https://pkgs.dev.azure.com/{otherorganization}/_packaging/{feed}/npm/registry/
    @{otherscope}:registry=https://{thirdPartyRepository}/npm/registry/
    always-auth=true
    

    在此处查看更多详细信息:https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/package/npm-authenticate?view=azure-devops

    【讨论】:

      猜你喜欢
      • 2019-10-27
      • 2020-01-11
      • 2020-04-23
      • 1970-01-01
      • 2020-06-18
      • 2021-07-01
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      相关资源
      最近更新 更多