Publishing Github packages for a monorepo as part of an organization

Another possible cause of this error (discussed and ruled out in the original question body) is if any package's package.json's repository field does not match the git URL of the repo - for example, if you transferred the repo to a different organisation, or renamed the repo, but didn't update every package's package.json with the new URL.

The error message will report 404 on https://npm.pkg.github.com/@org/package-name even if the problem is with the repository URL.

(credit to jonas-reif's comment)


The issue here was that we had repos in the organization with the same name as the package being published and it didn't like that.

When I looped back around to solving this I renamed the packages to not have a collision with another existing repo in the organization and it worked as expected.


I ran into the same issue, I had to generate a new personal access token that had more privileges. Just read:packages and write:packages was not sufficient, you also needed repo.