简体   繁体   中英

403 when requesting private gemfury package for install

How can I install private packages from gemfury from my own account.

I'm getting a 403 when trying to install a private package from my gemfury account.

yarn --verbose
...
verbose 0.22845086 Found configuration file "/Users/chrisbest/Documents/test-client/.yarnrc".
...
verbose 0.234278553 current time: 2020-08-26T17:06:01.680Z
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
verbose 0.454187488 Performing "GET" request to "https://npm.fury.io/testorg/@testscope%2fbutton".
verbose 1.61564947 Request "https://npm.fury.io/testorg/@testscope%2fbutton" finished with status code 403.
verbose 1.630735964 Error: Couldn't find package "@testscope/button@^1.0.0" required by "test-client@0.1.0" on the "npm" registry.

I have a trial on Gemfury with an organization account and an individual account that is a collaborator.

I have published a package that I can see through the web UI called button (I have also tried @lhpublic/button`).

I have added the scoped registry url to the .yarnrc file listed as having been found above "@testscope:registry" "https://npm.fury.io/testorg/" , and yarn does make the request to the url I specified.

I have set npm config set always-auth true and logged in to the registry using my gemfury collaborator account npm login --registry=https://npm.fury.io/testorg and in ~/.npmrc I see

always-auth=true
//npm.fury.io/:_authToken={my token}

I also see a 403 when running yarn --verbose info @testscope/button , while yarn --verbose info button successfully returns info for the unrelated button package on the public npm registry.

It looks like you've omitted the URL trailing slash in your npm login command. If you run the command as:

$ npm login --registry="https://npm.fury.io/testorg/"

npm will correctly save the credentials for your Gemfury repo in ~/.npmrc:

//npm.fury.io/testorg/:_authToken={my token}

Ref: https://gemfury.com/help/private-yarn/#scoped-packages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM