Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Can't install GitHub registry packages #765

Closed
jeremytenjo opened this issue Jan 25, 2020 · 8 comments
Closed

[Bug] Can't install GitHub registry packages #765

jeremytenjo opened this issue Jan 25, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@jeremytenjo
Copy link

Describe the bug

Running yarn produces a Response code 404 (Not Found) error

To Reproduce

$ git clone https://github.com/tenjojeremy/Visual-Regression-Tester.git
$ cd Visual-Regression-Tester
$ yarn install

Screenshots

error

Environment if relevant (please complete the following information):

  • Windows 10
  • Node version 12.13.1
  • Yarn version 2.0.0-rc.27
@jeremytenjo jeremytenjo added the bug Something isn't working label Jan 25, 2020
@arcanis
Copy link
Member

arcanis commented Jan 25, 2020

Configuration changed - .npmrc isn't read anymore, only .yarnrc.yml is. Check npmRegistryServer and related.

@jeremytenjo
Copy link
Author

Thanks for the quick reply.

I added .yarnrc.yml

npmRegistries:
  tenjojeremy:
    npmAlwaysAuth: true
npmScopes:
  tenjojeremy:
    npmRegistryServer: "https://npm.pkg.github.com/"

When I run yarn I get a Response code 401 (Unauthorized) error

a

Repo: https://github.com/tenjojeremy/Visual-Regression-Tester

@arcanis
Copy link
Member

arcanis commented Jan 25, 2020

You need to authenticate to the GH registry, it doesn't support public unauthenticated access

@jeremytenjo
Copy link
Author

I still get the error when authenticated

b

@arcanis
Copy link
Member

arcanis commented Jan 25, 2020

Well - npm login will generate the npm configuration files, not the Yarn configuration files.

Try yarn npm login --scope tenjojeremy

@jeremytenjo
Copy link
Author

Same error

c

@arcanis
Copy link
Member

arcanis commented Jan 26, 2020

Found the problem - in your project Yarnrc you said you have the following:

npmRegistries:
  tenjojeremy:
    npmAlwaysAuth: true

Remove it, and in $HOME/.yarnrc.yml add the following:

npmRegistries:
  "https://npm.pkg.github.com":
    npmAlwaysAuth: true

The key was incorrect in npmRegistries, and because you had it in two files the local one (without the auth token) was overwriting the global one (with the token). As a result, your requests were unauthenticated. I'll open another issue to track configuration merging.

@arcanis
Copy link
Member

arcanis commented Jan 26, 2020

Closing in favour of #779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants