当前位置 : 主页 > 网页制作 > Nodejs >

node.js – 私有依赖项的npm安装不起作用,但克隆确实如此

来源:互联网 收集:自由互联 发布时间:2021-06-16
我的package.json中有3个私有依赖项.当我运行npm install时,我得到了错误.请注意我什么时候克隆它只有NPM安装不工作 Cloning into bare repository Permission denied (publickey). fatal: Could not read from remot
我的package.json中有3个私有依赖项.当我运行npm install时,我得到了错误.请注意我什么时候克隆它只有NPM安装不工作

Cloning into bare repository  
Permission denied (publickey). 
fatal: Could not read from remote repository. 
Please make sure you have the correct access rights and the repository exists.

整个日志如下所示.

几乎没有相关的类似问题,但它们都没有在我的场景中提供解决方案.最初我认为这是nodejs和npm版本问题所以我通过运行windows nodejs.msi来更新它们,目前版本如图所示.

我的package.json的内容如下:(大部分内容被删除,只提到了重要的私有依赖项)

"dependencies": {
    "private-dep2": "git+ssh://git@github.comp.com:reph/private-dep2.git#v0.3.5"
  },
  "devDependencies": {
    "ember-cli": "0.2.5",
    "ember-cli-app-version": "0.3.3",    
    "tough-cookie": "^0.12.1",
    "private-dep3": "git+ssh://git@github.comp.com:reph/private-dep3.git#v0.3.5",
    "private-dep1": "git+ssh://git@github.comp.com:reph/private-dep1.git#v0.7.5"
  }

整个日志如下:

PS C:\DDrive\Projects\p-ceck> npm cache clean
PS C:\DDrive\Projects\p-ceck>
PS C:\DDrive\Projects\p-ceck>
PS C:\DDrive\Projects\p-ceck> bower cache clean
PS C:\DDrive\Projects\p-ceck>
PS C:\DDrive\Projects\p-ceck>
PS C:\DDrive\Projects\p-ceck>
PS C:\DDrive\Projects\p-ceck> npm install
Enter passphrase for key '/c/Users/user_name/.ssh/id_rsa': Enter passphrase for key '/c/Users/user_name/.ssh/id_rsa': Enter passphrase for key|'/c/Users/user_name/.ssh/id_rsa': |
/nter passphrase for key '/c/Users/user_name/.ssh/id_rsa': /
-nter passphrase for key '/c/Users/user_name/.ssh/id_rsa': -
/nter passphrase for key '/c/Users/user_name/.ssh/id_rsa': \
|nter passphrase for key '/c/Users/user_name/.ssh/id_rsa': -
//ter passphrase for key '/c/Users/user_name/.ssh/id_rsa': /
-nter passphrase for key '/c/Users/user_name/.ssh/id_rsa': -
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496: Cloning into bare repository 'C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496'...
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496: Permission denied (publickey).
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496: fatal: Could not read from remote repository.
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496:
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496: Please make sure you have the correct access rights
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496: and the repository exists.
/
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3: Cloning into bare repository 'C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3'...
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3: Permission denied (publickey).
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3: fatal: Could not read from remote repository.
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3:
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3: Please make sure you have the correct access rights
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep1.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep1-git-82b6a6b3: and the repository exists.
/
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6: Cloning into bare repository 'C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6'...
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6: Permission denied (publickey).
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6: fatal: Could not read from remote repository.
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6:
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6: Please make sure you have the correct access rights
npm ERR! git clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep2.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep2-git-426ffed6: and the repository exists.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://git@github.comp.com/reph/private-dep3.git C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496
npm ERR! Cloning into bare repository 'C:\Users\user_name\AppData\Roaming\npm-cache\_git-remotes\ssh-git-github-comp-com-reph-private-dep3-git-bf7ad496'...
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.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\DDrive\Projects\p-ceck\npm-debug.log
我遇到了类似的问题.我最终为我的机器设置了ssh密钥,npm能够安装没有问题.

How to set up ssh keys for github.com

网友评论