Aron
Aron

Reputation: 1272

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?

Upvotes: 0

Views: 3444

Answers (3)

Phoghelius
Phoghelius

Reputation: 518

In my case I had forgotten to authorize the newly created access token with my organisation's SSO. Had to click "Authorize SSO" next to the token once and authorize it, after that the install worked.

Upvotes: 0

Aron
Aron

Reputation: 1272

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.

Upvotes: 1

yanir midler
yanir midler

Reputation: 2702

Looks like yarn is causing issue. followed the below steps and that did the trick.

npm uninstall –g yarn

npm cache clean –force

npx create-react-app my-app

Upvotes: 0

Related Questions