【问题标题】:npm install access denied error on ssh git repo - windows7ssh git repo上的npm安装访问被拒绝错误-windows7
【发布时间】:2014-05-18 22:22:26
【问题描述】:

我正在尝试帮助另一位开发人员在他们的 Windows 机器上运行 npm install,但他们在 package.json 中的一个私有项目依赖项中遇到访问被拒绝错误。克隆的项目来自同一个域,并且在 Stash 中的同一个项目中。

1222 silly lockFile 836362be-che-generator-cuff-0-0-1-package tar://C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package
1223 silly lockFile 836362be-che-generator-cuff-0-0-1-package tar://C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package
1224 silly lockFile 47037b47-generator-cuff-0-0-1-package-tgz tar://C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package.tgz
1225 silly lockFile 47037b47-generator-cuff-0-0-1-package-tgz tar://C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package.tgz
1226 verbose chmod C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package.tgz 644
1227 silly chown skipping for windows C:\Users\knzn\AppData\Roaming\npm-cache\generator-cuff\0.0.1\package.tgz
1228 silly lockFile 9e23d6fc-net-7999-chui-generator-cuff-git ssh://git@domain:port/project/generator-cuff.git
1229 silly lockFile 9e23d6fc-net-7999-chui-generator-cuff-git ssh://git@domain:port/project/generator-cuff.git
1230 error git fetch -a origin (ssh://git@domain:port/project/grunt-cuff.git) Permission denied (publickey).
1230 error git fetch -a origin (ssh://git@domain:port/project/grunt-cuff.git) fatal: Could not read from remote repository.
1230 error git fetch -a origin (ssh://git@domain:port/project/grunt-cuff.git)
1230 error git fetch -a origin (ssh://git@domain:port/project/grunt-cuff.git) Please make sure you have the correct access rights
1230 error git fetch -a origin (ssh://git@domain:port/project/grunt-cuff.git) and the repository exists.
1231 silly lockFile 16f0d96e-ter-net-7999-chui-grunt-cuff-git ssh://git@domain:port/project/grunt-cuff.git
1232 silly lockFile 16f0d96e-ter-net-7999-chui-grunt-cuff-git ssh://git@domain:port/project/grunt-cuff.git
1233 error Error: Command failed: Permission denied (publickey).
1233 error fatal: Could not read from remote repository.
1233 error
1233 error Please make sure you have the correct access rights
1233 error and the repository exists.
1233 error
1233 error     at ChildProcess.exithandler (child_process.js:637:15)
1233 error     at ChildProcess.EventEmitter.emit (events.js:98:17)
1233 error     at maybeClose (child_process.js:743:16)
1233 error     at Socket.<anonymous> (child_process.js:956:11)
1233 error     at Socket.EventEmitter.emit (events.js:95:17)
1233 error     at Pipe.close (net.js:465:12)
1234 error If you need help, you may report this *entire* log,
1234 error including the npm and node versions, at:
1234 error     <http://github.com/npm/npm/issues>
1235 error System Windows_NT 6.1.7601
1236 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--verbose"
1237 error cwd C:\Users\knzn\workspace\my-project.net\repo\project
1238 error node -v v0.10.26
1239 error npm -v 1.4.3
1240 error code 128

我在 OSX 上,没有任何问题。由于另一个开发人员是远程的,我决定在我们工作时使用的新的 Windows7-64 位笔记本电脑上测试自己,看看我是否可以重现和解决。我们正在使用 stash,这是一个私人仓库,我可以自己成功克隆。

> git clone ssh://git@domain:port/project/generator-cuff.git
Cloning into 'generator-cuff'...
Enter passphrase for key '/c/Users/knzn/.ssh/id_rsa':
remote: Counting objects: 86, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 86 (delta 29), reused 0 (delta 0)
Receiving objects: 100% (86/86), 56.00 KiB | 35.00 KiB/s, done.
Resolving deltas: 100% (29/29), done.
Checking connectivity... done.

有什么想法吗?

我正在使用

> ssh -v
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004

> git --version
git version 1.9.0.msysgit.0

上述日志中的 npm 信息

提前致谢。

编辑:其他开发人员能够通过生成一个新的 SSH 密钥解决此问题,但这与 Atlassian 本身提供的说明相反创建 SSH 密钥,所以这可能会导致更多的隐藏问题。

https://confluence.atlassian.com/display/STASH/Creating+SSH+keys#CreatingSSHkeys-CreatinganSSHkeyonWindows

【问题讨论】:

  • 任何机会您都可以显示您的package.json 以显示您如何引用存储模式下的包(显然屏蔽主机等)。

标签: git npm windows-7-x64 openssh bitbucket-server


【解决方案1】:

Atlassian 确认解决方案确实是在没有密码的情况下在 Windows 中创建 SSH 密钥。似乎 NPM 的问题可能更多。

【讨论】:

    猜你喜欢
    • 2013-09-09
    • 2015-08-04
    • 1970-01-01
    • 2016-06-20
    • 1970-01-01
    • 1970-01-01
    • 2015-09-19
    • 1970-01-01
    相关资源
    最近更新 更多