简体   繁体   English

NPM 安装因私有仓库而失败

[英]NPM install fails with private repo

  1. npm login . npm login
  2. I enter username, password and e-mail --> I'm succesfully logged in.我输入用户名、密码和电子邮件 --> 我已成功登录。
  3. I make change to a package.我对包裹进行了更改。
  4. I run npm publish and the (org) package gets published and I can browse it (when I'm logged in) at NPM website.我运行npm publish并且 (org) 包被发布,我可以在 NPM 网站上浏览它(当我登录时)。

5. But when I try to install the same package like: npm install @my_handle/package_name I get the error: 404. Not found: @my_handle/package_name@latest 5. 但是当我尝试安装相同的包时: npm install @my_handle/package_name我收到错误:404。未找到:@my_handle/package_name@latest

When I run a: npm config edit it contains the following:当我运行 a: npm config edit它包含以下内容:

//registry.npmjs.org/:_authToken=my_token
@my_handle=https://registry.npmjs.org/
@my_handle:registry=https://registry.npmjs.org/
always-auth=true

When I login to NPM, click Settings and the try to run the package via the green link ">_try on RunKit" --> It is also saying that the package is missing!?当我登录到 NPM 时,单击“设置”并尝试通过绿色链接“>_try on RunKit”运行该包--> 它还说该包丢失了!? What?什么? I have now clicked the "report" button...thus I don't get was is happening?我现在点击了“报告”按钮......因此我不明白发生了什么?

Solved!解决了!

The issue was - that I found an old ".npmrc" file in the root of the directory I tried to run the npm install from (and it contained an invalid AUTH token).问题是 - 我在尝试运行npm install的目录的根目录中发现了一个旧的“.npmrc”文件(并且它包含无效的 AUTH 令牌)。 Because I logged into the console and publish worked out fine...I didn't realize this issue before many hours later...因为我登录到控制台并发布效果很好......在几个小时后我没有意识到这个问题......

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

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