I created and published a private Github package. Trying to install it with yarn at first, I face the following issue:
Whether I try with yarn or npm, it cannot find the package at all although following the exact steps documented by Github (https://help.github.com/en/github/managing-packages-with-github-package-registry/configuring-npm-for-use-with-github-package-registry).
My .yarnrc
:
registry "https://npm.pkg.github.com/OWNER"
With yarn, it continuously tries to look for the package at https://registry.yarnpkg.com/@GITHUB_USERNAME
instead of the registry I entered above.
Remark: in .yarnrc
registries need to be added following a slightly different syntax:
registry "https://npm.pkg.github.com/"
So far I started to also play around with a mix of .npmrc
and .yarnrc
configurations but no luck.
-
EDIT (Partly solved)
I figured out how to actually access the package, both using npm or - in my case - yarn. Now I face the issue of a Request failed \"401 Unauthorized\"
error, although I added the credentials on top of .yarnrc
:
//npm.pkg.github.com/:_authToken=AUTH_TOKEN
Doing the same in .npmrc
doesn't work either.