I'm trying to upload a package on GPR (Github Package registry). I log in successfully:
npm login --registry=https://npm.pkg.github.com
and then run these command:
npm set registry https://npm.pkg.github.com/
npm publish
which returns this error:
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/package-name
npm ERR! 404
npm ERR! 404 'package-name@version' is not in the npm registry.
Seems it tries to upload a package on npm registry instead of github package registry. How should I fix this problem?
GitHub Packages is a platform for hosting and managing packages, including containers and other dependencies. GitHub Packages combines your source code and packages in one place to provide integrated permissions management and billing, so you can centralize your software development on GitHub.
There are two ways to solve this problem:
publishConfig
option in package.json
:"publishConfig": {
"registry":"https://npm.pkg.github.com/@OWNER"
},
.npmrc
file to your project with this content:registry=https://npm.pkg.github.com/@OWNER
replacing OWNER
with the name of the user or organization account on GitHub that owns the repository where you will publish the package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With