Question

I am trying to help another developer run npm install on their windows machine but they are getting an access denied error with one of the private project dependencies in package.json. The project the cloned one is coming from is on the same domain and is in the same project in 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

I am on OSX and have no problems. Since the other developer is remote, I decided to test myself on a fresh Windows7-64bit laptop we had at work and see if I could reproduce and solve. We are using stash, and this is a private repo which I can successfully clone on its own.

> 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.

Any thoughts?

I am using

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

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

npm info in the above logs

Thanks in advance.

edit: the other developer was able to get around the issue by generating a new SSH key without a passphrase, but this is contrary to the instructions Atlassian itself provides for creating SSH keys, so maybe this leads itself to being more of a stash issue then.

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

Was it helpful?

Solution

Atlassian confirmed that the solution was indeed to create SSH key in Windows without the passphrase. Seems the issue may be more with NPM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top