yarn icon indicating copy to clipboard operation
yarn copied to clipboard

yarn install with full path to private registry in .npmrc fails

Open pnewhook opened this issue 4 years ago • 2 comments

Bug description

My team uses Artifactory as a mirror to to the public NPM registry. All packages are downloaded from Artificatory, never npm directly. However I've found that yarn can't authenticate against a private registry if the full path is given. i.e. in my .npmrc this works

registry = https://myrepo.jfrog.io/

but this doesn't

registry = https://myrepo.jfrog.io/hooppisg/api/npm/my-private-registry

This user appears to be having the same problem: https://github.com/yarnpkg/yarn/issues/4451#issuecomment-610939809. NPM install works fine in either case. And with the shorter registry URL yarn install won't work without specifying the registry.

Command

yarn install

What is the current behavior?

 C:\Users\pnewhook\dev\isg-core\settlement-workflow\settlement-dashboard-ui> yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://myrepo.jfrog.io/hooppisg/api/npm/my-private-registry/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\me\\dev\\project\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

What is the expected behavior? I'd expect the packages to be downloaded from my registry.

Steps to Reproduce

  1. Configure a non-default registry in .npmrc with authentication, using the full path to the repo, not just the host.
  2. yarn install

Environment

Yarn version: 1.22.4

Node version: 12.18.0

Platform: win32 x64

pnewhook avatar Jun 26 '20 19:06 pnewhook

If you can, try reinstalling the yarn command line and try the catastrophe

fkhy456 avatar Jun 28 '20 08:06 fkhy456

Was there a solution to this? Experiencing the same issue with yarn where npm works

doppelganger113 avatar Mar 17 '21 13:03 doppelganger113