yarn 能否用于从本地 Azure Artifacts 存储库中获取包?
Can yarn be used to fetch packages from an on-prem Azure Artifacts repository?
我们使用本地 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 !]>
其中 platform_catalog 是供稿的名称:
但是当我 运行 yarn 我得到这个:
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 提要中,但是 yarn 似乎根本没有检查它,尽管 .yarnrc 文件要求检查。
我错过了什么?
编辑 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 中的包,它肯定不存在。我认为 yarn 没有出现 401 是一个可用性问题。
Can yarn be used to fetch packages from an on-prem Azure Artifacts
repository?
回答这个问题,别着急,TFS支持yarn消费神器
错误信息与纱线本身更相关。
这里有一些您可以尝试的故障排除方法:
1) 是否有任何网络问题,例如防火墙等
2) 确认没有为任何 .yarnrc
或 .npmrc
文件设置不同的注册表。
如果上述检查后问题依旧,可以在命令中添加--verbose
获取详细的执行日志并分析。
我们使用本地 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 !]>
其中 platform_catalog 是供稿的名称:
但是当我 运行 yarn 我得到这个:
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 提要中,但是 yarn 似乎根本没有检查它,尽管 .yarnrc 文件要求检查。
我错过了什么?
编辑 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 中的包,它肯定不存在。我认为 yarn 没有出现 401 是一个可用性问题。
Can yarn be used to fetch packages from an on-prem Azure Artifacts repository?
回答这个问题,别着急,TFS支持yarn消费神器
错误信息与纱线本身更相关。
这里有一些您可以尝试的故障排除方法:
1) 是否有任何网络问题,例如防火墙等
2) 确认没有为任何 .yarnrc
或 .npmrc
文件设置不同的注册表。
如果上述检查后问题依旧,可以在命令中添加--verbose
获取详细的执行日志并分析。