2017-10-19 126 views
0

我目前正在尝试安装来自DefinitelyTyped回购的bleno的类型定义。我正在使用的命令是无法安装DefinitelyTyped Typscript定义。获取“权限被拒绝(公钥)”。通过npm

npm install --save @types/bleno 

但似乎我不允许克隆回购。

npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
npm ERR! git clone [email protected]:types/bleno Cloning into bare 
repository '/root/.npm/_git-remotes/git-github-com-types-bleno- 
71caf4ab'... 
npm ERR! git clone [email protected]:types/bleno Permission denied 
(publickey). 
npm ERR! git clone [email protected]:types/bleno fatal: Could not read 
from remote repository. 
npm ERR! git clone [email protected]:types/bleno 
npm ERR! git clone [email protected]:types/bleno Please make sure you have 
the correct access rights 
npm ERR! git clone [email protected]:types/bleno and the repository 
exists. 
npm ERR! addLocal Could not install types/bleno 
npm ERR! Error: ENOENT: no such file or directory, stat 'types/bleno' 
npm ERR!  at Error (native) 
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at: 
npm ERR!  <http://github.com/npm/npm/issues> 

npm ERR! System Linux 4.9.41-v7+  
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" 
"@types/bleno" 
npm ERR! cwd /home/nils/BluetoothServer 
npm ERR! node -v v4.8.2 
npm ERR! npm -v 1.4.21 
npm ERR! path types/bleno 
npm ERR! syscall stat 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/nils/BluetoothServer/npm-debug.log 
npm ERR! not ok code 0 

当然我试图使用sudo,我添加了SSH密钥到github上,我能够通过

ssh -T [email protected] 

连接到GitHub上,但我的问题仍然存在。我究竟做错了什么?

回答

0

花了早上试图解决问题后,当然不久后问我找到灵魂。我将npm升级到了3.10.10版,并且工作正常,没问题。