0
votes

We use on-prem Azure DevOps Server 2019.

In my project dir I have the following .yarnrc file:

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 !]>

Where platform_catalog is the name of the feed: enter image description here

But when I run yarn I get this:

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 !]>

As you can see on the image, the package is there on our Azure Artifacts npm feed, however yarn does not seem to inspect it at all, despite .yarnrc file asking to.

What am I missing?

EDIT 1

The --verbose flag helps to understand what is going on:

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 gets 401 talking to the custom repository, but it silently swallows it and proceeds to check the package in the npm, where it certainly does not exist. The fact that yarn does not surface 401 is a usability issue, I think.

1

1 Answers

0
votes

Can yarn be used to fetch packages from an on-prem Azure Artifacts repository?

Answer this question, don't worry, TFS support yarn to consume the artifacts.

enter image description here


The error message more relevant with yarn itself.

Here some troubleshooting method you can try:

1) Whether it has any network issues, e.g Firewall and etc.

2) Confirm that there's no different registry set for any of .yarnrc or .npmrc files.

If the issue still occurred after above checked, you can add --verbose to command to get detailed execution log and analyze it.