Search code examples
npmyarnpkg

yarn add - 403 (Forbidden)


I have published a private package in my company as @company/package-name, I can see it in our github repository.

After that, I did yarn add @company/package-name in another project and I got:

➤ YN0027: @company/package-name@unknown can't be resolved to a satisfying range
➤ YN0035: The remote server failed to provide the requested resource
➤ YN0035:   Response Code: 403 (Forbidden)
➤ YN0035:   Request Method: GET
➤ YN0035:   Request URL: https://npm.pkg.github.com/@company%2fname

It is weird, I can publish but I cannot install it. Do you have any idea please?


Solution

  • Finally I got the source of errors.

    The checkbox Inherit access from source repository (recommended) was unchecked in the package settings page.

    I have enabled it, and now, we can publish (also with --experimental) and also download this new package.

    Thank you Trond Glomnes for your help.