Berry: [Bug] Can't fetch private package from Github package registry

Created on 30 Jan 2020  Â·  3Comments  Â·  Source: yarnpkg/berry

  • [ ] I'd be willing to implement a fix

Describe the bug

We're using Github package registry for our internal packages. When I'm trying to add a package that worked with Yarn v1 I get Response code 400 (Bad Request). I used yarn npm login --scope my-company to auth against the registry.

To Reproduce

.yarnrc.yml

yarnPath: .yarn/releases/yarn-sources.js
npmScopes:
    my-company:
        npmRegistryServer: "https://npm.pkg.github.com"
$ yarn set version from sources

$ yarn npm whoami --scope my-company
➤ YN0000: Santas
➤ YN0000: Done in 0.69s

$ yarn add @my-company/ui-components
...
➤ YN0000: ┌ Fetch step
➤ YN0013: │ @my-company/ui-components@npm:20.0.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40my-company%2Fui-components%2F20.0.0%2F61118bd63abe1f7f4f8a6081e0002c9db9cf65e53043894ea4bb2a1fa06890a6 can't be found in the cache and will be fetched from the remote server
➤ YN0001: │ HTTPError: @my-company/ui-components@npm:20.0.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40my-company%2Fui-components%2F20.0.0%2F61118bd63abe1f7f4f8a6081e0002c9db9cf65e53043894ea4bb2a1fa06890a6: Response code 400 (Bad Request)
    at EventEmitter.l.on (/Users/santas/my-company/my-project/.yarn/releases/yarn-sources.js:24:310187)
    at process._tickCallback (internal/process/next_tick.js:68:7)
➤ YN0000: └ Completed in 1.59s
➤ YN0000: Failed with errors in 2.9s

Environment if relevant (please complete the following information):

  • OS: OS X 10.15.2
  • Node version 12.14.0
  • Yarn version 2.0.0-rc.28 from sources b0c9d687a783f72161f78a2b4e4b1a516c283171
bug

Most helpful comment

@deini Okay, seems to work now. Thanks!

All 3 comments

I installed Yarn Berry today but also hitting this issue.
The difference to then configuration above is that I have an auth token defined in a global .yarnrc.yml located under ~.
Is that an unsupported scenario?

@levrik Yes, it should be supported. It just got fixed yesterday tho.

Can you try it out with the latest source version?
yarn set version from sources

@deini Okay, seems to work now. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janicduplessis picture janicduplessis  Â·  4Comments

wojtekmaj picture wojtekmaj  Â·  3Comments

kiprasmel picture kiprasmel  Â·  3Comments

tiansijie picture tiansijie  Â·  4Comments

Mike-Dax picture Mike-Dax  Â·  3Comments