question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to publish to Github Packages?

See original GitHub issue

Affected Packages

CLI publish command

Problem

It appears that the current publish command always assumes the public registry. If there is a way to do this with the current version of changesets I haven’t been able to figure it out.

Proposed solution

Update publish command to check publishConfig.registry before publishing to the public registry.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
aussiegeekcommented, Mar 5, 2020

I am publishing private packages to GitHub using changesets.

I’ve added this config to the individual package:

"publishConfig": {
    "registry": "https://npm.pkg.github.com"
},
"repository": {
    "type": "git",
    "url": "ssh://git@github.com/user/repo.git",
    "directory": "packages/package-name"
}

Because there are multiple packages published from the one repo, you need the repository key to point back at GitHub (see https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#publishing-multiple-packages-to-the-same-repository)

0reactions
tometo-devcommented, Nov 9, 2022

Hi @aussiegeek, Possible to share how you were able to publish packages to github using changesets. Everytime I try, it gives the following error:

🦋  error ENEEDAUTH This command requires you to be logged in to https://npm.pkg.github.com/ 
🦋  error You need to authorize this machine using `npm adduser`
🦋  error npm ERR! code ENEEDAUTH
🦋  error npm ERR! need auth This command requires you to be logged in to https://npm.pkg.github.com/
🦋  error npm ERR! need auth You need to authorize this machine using `npm adduser`
🦋  error {
🦋  error   "error": {
🦋  error     "code": "ENEEDAUTH",
🦋  error     "summary": "This command requires you to be logged in to https://npm.pkg.github.com/",
🦋  error     "detail": "You need to authorize this machine using `npm adduser`"
🦋  error   }
🦋  error }

Snippet from release.yml file:

- name: Create Release Pull Request or Publish
   uses: changesets/action@v1
   with:
       publish: yarn changeset:release
       commit: "chore: version packages"
       title: "chore: version packages"
    env:
       GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quickstart for GitHub Packages
Publishing your package · Create a new repository on GitHub, adding the . · Create an index. · Initialize an npm package with...
Read more >
Publish Github Package
Github package repository is where you can publish npm, gem, mvn, nuget, gradle, docker packages and is currently now in beta.
Read more >
Quickly publish and install a library with GitHub Packages
GitHub Packages allows us to directly host a package we create. This comes with a whole swath of functionalities since it's tied to...
Read more >
Publish an npm to GitHub packages
GitHub provides the GitHub Package Registry to publish private npm packages. We can also use it for Docker images and libraries for other ......
Read more >
Publishing private npm packages using GitHub Packages
You'll need to generate what is known as a personal access token. This token will allow you to be able to authenticate with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found