Skip to content
Discussion options

You must be logged in to vote

A 403 Forbidden error when publishing to GitHub Packages is usually related to authentication, permissions, or package configuration rather than npm itself.

Here are a few things to verify:

Make sure your Personal Access Token includes both write:packages and read:packages. If you're publishing to a private repository, ensure it also has the appropriate repo permissions if required.
Confirm that the package scope in package.json matches your GitHub username or organization. For example:
{
"name": "@your-username/package-name"
}
Verify that your .npmrc file is configured to use the GitHub Packages registry for your package scope, for example:
@your-username:registry=https://npm.pkg.github.com

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by daniyal-debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packages Host your dependencies, libraries, and production-ready code, right from your repository Question Ask and answer questions about GitHub features and usage source:ui Discussions created via Community GitHub templates
2 participants