[英]Permission error to use private git repo in package.json for npm install using https protocol
I'm using this url in package.json in dependancies using https 我使用https在依赖关系中在package.json中使用此URL
<private repo>:"git+https://<token>:x-oauth-basic@github.com/<org>/<private repo>"
Also I have tried with this one 我也尝试过这个
<private repo>:"git+https://<token>:x-oauth-basic@github.com/<org>/<private repo>.git"
add only .git at the end 最后只添加.git
And I know token is valid Becz 而且我知道令牌是有效的Becz
When I'm cloning this repo using this below command on terminal working fine 当我在终端上使用以下命令克隆此仓库时工作正常
git clone https://<token>:x-oauth-basic@github.com/<org>/<private repo>.git
So I'm getting error like this even though I'm not use ssh
protocole 所以即使我不使用
ssh
协议,也会出现这样的错误
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
And I've created this token by selecting scopes read:org,write:org
我通过选择范围
read:org,write:org
创建了该令牌
Check your version of NPM (npm -v). 检查您的NPM版本(npm -v)。 There is a bug in NPM 2.7.4 (and maybe 2.7.5) that causes cloning of private repos to fail.
NPM 2.7.4(也许是2.7.5)中存在一个错误,该错误会导致私有存储库的克隆失败。
See: https://github.com/nodejs/node/issues/1323 参见: https : //github.com/nodejs/node/issues/1323
I ran into this today with 2.7.4 installed. 今天,我遇到了安装2.7.4的问题。 I updated to the latest nodejs which brought down NPM 2.11.3, and I was able to get a private repo over git+https with token just fine.
我更新到了最新的nodejs,它降低了NPM 2.11.3的性能,并且能够通过git + https获得带有令牌的私有仓库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.