简体   繁体   English

403 请求安装私有 gemfury 包时

[英]403 when requesting private gemfury package for install

How can I install private packages from gemfury from my own account.如何从我自己的帐户安装 gemfury 的私有软件包。

I'm getting a 403 when trying to install a private package from my gemfury account.尝试从我的 gemfury 帐户安装私有包时收到 403。

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.我在 Gemfury 上试用了一个组织帐户和一个作为协作者的个人帐户。

I have published a package that I can see through the web UI called button (I have also tried @lhpublic/button`).我发布了一个包,我可以通过名为button的 Web UI 看到它(我也尝试过 @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.我已将范围注册表 url 添加到列出的 .yarnrc 文件中,该文件已在"@testscope:registry" "https://npm.fury.io/testorg/"上方找到,并且 yarn 确实向我指定的 url 发出请求.

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我已将npm config set always-auth true并使用我的 gemfury 合作者帐户npm login --registry=https://npm.fury.io/testorg并在 ~/.npmrc 中登录到注册表,我看到

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.我在运行yarn --verbose info @testscope/button时也看到 403,而yarn --verbose info button成功返回公共 npm 注册表上不相关button包的信息。

It looks like you've omitted the URL trailing slash in your npm login command.看起来您在npm login命令中省略了 URL 尾部斜杠。 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 将在 ~/.npmrc 中正确保存 Gemfury 存储库的凭据:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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