{"id":126,"hash":"3c504ee31fa3cccd0d0227197bda0790f204bf39a5caa1842c02995a48dc057c","pattern":"Installing packages from github npm registry - auth error 401","full_message":"I have just published a private package on GitHub, trying to figure out how it should be working. now I'm trying to install it in another project. I authenticated with npm login --registry=https://npm.pkg.github.com with an access token that has write:packages, read:packages and repo privileges. While trying to run npm install https://npm.pkg.github.com/@orgname/package-name I get an error message:\n\nnpm ERR! code E401\nnpm ERR! Unable to authenticate, need: Basic realm=\"GitHub Package Registry\"\n\nHow can I add/get this privilege?","ecosystem":"npm","package_name":"github","package_version":null,"solution":"Apparently I'm an idiot who can't read documentation and missed that part:\n\nIn the same directory as your package.json file, create or edit an .npmrc file to include a line specifying GitHub Packages URL and the account owner. Replace OWNER with the name of the user or organization account that owns the repository containing your project.\n\nregistry=https://npm.pkg.github.com/OWNER","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/58919401/installing-packages-from-github-npm-registry-auth-error-401","votes":84,"created_at":"2026-04-19T04:41:21.904031+00:00","updated_at":"2026-04-19T04:51:03.653384+00:00"}