npm - 是否可以使用 yarn 从本地 Azure Artifacts 存储库中获取包?
问题描述
我们使用本地 Azure DevOps Server 2019。
在我的项目目录中,我有以下 .yarnrc 文件:
C:\xyz\tip\ui\EngagementCommon.UI [master ≡ +3 ~1 -1 !]> cat .\.yarnrc
registry "http://tfsserver.xyz.com:8080/tfs/DefaultCollection/_packaging/platform_catalog/npm/registry/"
C:\xyz\tip\ui\EngagementCommon.UI [master ≡ +3 ~1 -1 !]>
但是当我运行纱线时,我得到了这个:
C:\xyz\tip\ui\EngagementCommon.UI [master ≡ +3 ~1 -1 !]> yarn
yarn install v1.22.0
[1/4] Resolving packages...
error Couldn't find package "@platform/catalog" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
C:\xyz\tip\ui\EngagementCommon.UI [master ≡ +3 ~1 -1 !]> cat .\package.json|sls catalog
"@platform/catalog": "^1.0.71",
C:\xyz\tip\ui\EngagementCommon.UI [master ≡ +3 ~1 -1 !]>
正如您在图片中看到的,该包位于我们的 Azure Artifacts npm 提要中,但是尽管 .yarnrc 文件要求,yarn 似乎根本没有检查它。
我错过了什么?
编辑 1
该--verbose
标志有助于了解正在发生的事情:
yarn --verbose
yarn install v1.22.0
verbose 0.1522596 Checking for configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.npmrc".
verbose 0.153013699 Found configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.npmrc".
verbose 0.154160399 Checking for configuration file "C:\\Users\\mkharitonov\\.npmrc".
verbose 0.15491 Found configuration file "C:\\Users\\mkharitonov\\.npmrc".
verbose 0.1557871 Checking for configuration file "C:\\Program Files\\nodejs\\etc\\npmrc".
verbose 0.1565483 Checking for configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.npmrc".
verbose 0.157282799 Found configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.npmrc".
verbose 0.158124099 Checking for configuration file "C:\\xyz\\tip\\UI\\.npmrc".
verbose 0.158851699 Checking for configuration file "C:\\xyz\\tip\\.npmrc".
verbose 0.159633599 Checking for configuration file "C:\\xyz\\.npmrc".
verbose 0.1642738 Checking for configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.yarnrc".
verbose 0.1689344 Checking for configuration file "C:\\Users\\mkharitonov\\.yarnrc".
verbose 0.1744512 Found configuration file "C:\\Users\\mkharitonov\\.yarnrc".
verbose 0.175591399 Checking for configuration file "C:\\Program Files\\nodejs\\etc\\yarnrc".
verbose 0.1781605 Checking for configuration file "C:\\xyz\\tip\\UI\\EngagementCommon.UI\\.yarnrc".
verbose 0.1789498 Checking for configuration file "C:\\xyz\\tip\\UI\\.yarnrc".
verbose 0.1796986 Checking for configuration file "C:\\xyz\\tip\\.yarnrc".
verbose 0.1804712 Checking for configuration file "C:\\xyz\\.yarnrc".
verbose 0.1856058 current time: 2020-02-20T15:19:28.047Z
[1/4] Resolving packages...
verbose 0.268615799 Performing "GET" request to "http://tfsserver.xyz.com:8080/tfs/DefaultCollection/_packaging/platform_catalog/npm/registry/@platform%2fcatalog".
verbose 0.2893787 Request "http://tfsserver.xyz.com:8080/tfs/DefaultCollection/_packaging/platform_catalog/npm/registry/@platform%2fcatalog" finished with status code 401.
verbose 0.3031119 Error: Couldn't find package "@platform/catalog" on the "npm" registry.
at MessageError.ExtendableBuiltin (C:\Program Files (x86)\Yarn\lib\cli.js:721:66)
at new MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:750:123)
at NpmResolver.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:50302:15)
at Generator.next (<anonymous>)
at step (C:\Program Files (x86)\Yarn\lib\cli.js:310:30)
at C:\Program Files (x86)\Yarn\lib\cli.js:321:13
at processTicksAndRejections (internal/process/task_queues.js:85:5)
error Couldn't find package "@platform/catalog" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Yarn 得到 401 与自定义存储库的对话,但它默默地吞下它并继续检查 npm 中的包,它肯定不存在。我认为,纱线没有出现在 401 表面这一事实是一个可用性问题。
解决方案
推荐阅读
- python - 电报机器人。如果用户使用测试消息,则推动用户使用按钮
- realm - 如何在后台线程中插入 Realm DB 中的大 api 响应并更新表视图 ui?
- python - 使用不同算法循环回归训练数据集
- angular - ng2-charts (chart.js) 条形图列无法呈现超过一定宽度
- sql - 在不断增长的表中,了解是否至少存在一条具有两个搜索(WHERE)条件的行的最快方法是什么?
- android - 如何使用谷歌广告管理器通过移动应用获利
- sql - 在 SQL 中的部分字符串上使用 levenshtein
- snowflake-cloud-data-platform - 未计划 CRON 的雪花任务
- javascript - 使用 React 在 Three.js 中将 SpriteMaterial 的“粒子”变为圆形或圆形
- laravel - 如何使用 Laravel 7.0 将值从路由传递到控制器?