[英]Azure devops failing to download private npm packages
I am using Azure DevOps for my node application, but I have private npm packages that fail with a 401 whenever DevOps runs the npm install
during the pipeline.我正在为我的节点应用程序使用 Azure DevOps,但我有私有 npm 包,只要 DevOps 在管道期间运行npm install
,这些包就会失败并显示 401。 I have run the additional npm task runner for authenticating where the Registry URL is set to https://npm.pkg.github.com/ along with the Username and Password for the npm account. I have run the additional npm task runner for authenticating where the Registry URL is set to https://npm.pkg.github.com/ along with the Username and Password for the npm account. Finally, I have created a.npmrc file locally within the project that contains @[organisation_name_here]:registry=https://npm.pkg.github.com/
.最后,我在项目中本地创建了一个包含@[organisation_name_here]:registry=https://npm.pkg.github.com/
的.npmrc 文件。 However, when I still run the pipeline I still receive the following error:但是,当我仍然运行管道时,我仍然收到以下错误:
npm ERR: 401 Unauthorized. @***/schemas@^1.0.8
I have seen and read about the ability to use Azure Artifacts, however, I would prefer not to avoid using them as I am slowly migrating over to AWS.我已经看到并阅读了有关使用 Azure 工件的能力,但是,我不想避免使用它们,因为我正在慢慢迁移到 AWS。 If Azure Artifacts is the only way, then please help!如果 Azure 神器是唯一的方法,那么请帮助! I'm slowly going insane XD lol我会慢慢发疯的XD哈哈
Thanks:)谢谢:)
If your .npmrc
contains Azure Artifacts registries from a different organization or use a third-party authenticated package repository, you'll need to set up npm service connections and specify them in the customEndpoint
input.如果您的.npmrc
包含来自不同组织的 Azure Artifacts 注册表或使用第三方认证的 package 存储库,您需要设置ZBB30E85411B56DF41296726AB4 服务中的自定义端点连接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
Check more details here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/package/npm-authenticate?view=azure-devops在此处查看更多详细信息: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/package/npm-authenticate?view=azure-devops
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.