Skip to content

Error with GitHub registery #650

Closed
Closed

Description

@JulienKode

Error with GitHub registery

I have the following .yarnrc.yml

enableImmutableInstalls: false

nodeLinker: node-modules

npmScopes:
  xxx-xxx:
    npmAuthToken: "${GITHUB_TOKEN-''}"
    npmPublishRegistry: "https://npm.pkg.github.com/"

Here is the CI that I have ("translated" into GitHub Actions, I use another CI than Github)

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - XXXX

      - run: yarn install --immutable

      - run: 'yarn changeset version && yarn config set enableImmutableInstalls false && yarn install && git add yarn.lock && git commit -m "chore: update lockfile [skip-ci]" && git push --set-upstream origin master'

      - run: yarn changeset publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The last command yarn changeset publish fail with the following error:

🦋  error Received an unknown error code: E401 for npm info "@xxx-xxx/test-publish"
🦋  error Unable to authenticate, need: Basic realm="GitHub Package Registry"
error Command failed with exit code 1.

When I use yarn npm publish instead I can publish the package,
Did you have any idea how I can fix the issue or understand why we have it

Activity

  1. changed the title [-]Configuration with a private registery [/-] [+]Error with GitHub registery[/+] on Oct 11, 2021
  2. erdoganoksuz commented on Oct 12, 2021

    @erdoganoksuz

    Setup node.js step create a npm file for you for this reason you should add all your variable to this step like following one.
    for more help; https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry

          - name: Setup Node.js 12.x
            uses: actions/setup-node@master
            with:
              node-version: 12.x
              registry-url: "https://npm.pkg.github.com"
              scope: "@yourscope"
            env:
              NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    
  3. Andarist commented on Oct 12, 2021

    @Andarist
    Member

    Thanks for the report - there are a couple of problems with alternative registries. I'm listing currently in the process of looking through issues to gather them all and to prepare a fixing plan.

  4. JulienKode commented on Oct 12, 2021

    @JulienKode
    ContributorAuthor

    Thanks for your reply @erdoganoksuz , I'll will check, but on the other CI system we do not use .npmrc at all

    Thanks @Andarist
    Let me know if you need any other info or help

  5. Andarist commented on Nov 20, 2021

    @Andarist
    Member

    @JulienKode it seems that we should switch to a yarn equivalent of npm info when using Yarn Berry. I'm reworking parts of the publish process in Changesets right now to make it work better with Berry but a fix for this one is not included in my work yet. I would first like to land a fix for a more standard publish process and then get back to this issue here and fix it.

  6. MikelArnaiz commented on Jun 6, 2024

    @MikelArnaiz

    Related; #965

  7. added theissue type on Dec 12, 2025
  8. bluwy commented on Aug 11, 2026

    @bluwy
    Member

    fixed in #2097

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions