Github Dependency Shorthand Not Working (Organization/Repository) #4732

Closed
framerate opened this Issue Feb 20, 2014 · 14 comments

Comments

Projects
None yet
8 participants

Anything after 1.4 is not allowing Organization/Package to be installed via npm install.

My package.json:

"dependencies": {
    "packagename": "Organization/package"
}

Ok, installed straight from nodejs.org (on OSX 10.9)

node --version v0.10.26

npm --version 1.4.4

npm ERR! git clone git://github.com/Organization/package Cloning into bare repository '/Users/framerate/.npm/_git-remotes/git-github-com-Organization-package-97f9ee85'...
npm ERR! git clone git://github.com/Organization/package
npm ERR! git clone git://github.com/Organization/package fatal: remote error:
npm ERR! git clone git://github.com/Organization/package   Repository not found.
npm ERR! Error: Command failed: fatal: remote error:
npm ERR!   Repository not found.
npm ERR!
npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)

github.com/Organization/package does exist, but it's private. Is there a missing step somewhere to connect to private repos that got lost when I updated?

Rolled back to 1.3.24 and worked my way to find where in the upstream it breaks. Hopefully this helps.

sudo npm install npm@1.4.0 -g BROKEN
sudo npm install npm@1.3.26 -g works..
sudo npm install npm@1.3.25 -g works
sudo npm install npm@1.3.24 -g works

Original (closed) issue where this was discovered: #4725

Still broken in 1.4.4

(changed name of organization/project)

npm ERR! git clone git://github.com/Organization/shared Cloning into bare repository '/Users/framerate/.npm/_git-remotes/git-github-com-Organization-shared-97f9ee85'...
npm ERR! git clone git://github.com/Organization/shared
npm ERR! git clone git://github.com/Organization/shared fatal: remote error:
npm ERR! git clone git://github.com/Organization/shared   Repository not found.
npm ERR! Error: Command failed: fatal: remote error:
npm ERR!   Repository not found.
npm ERR!
npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:743:16)
npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:465:12)
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 Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/framerate/code/project/web
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code 128

I was having this error as well, I got it to work with this syntax:

    "package": "git+ssh://git@github.com:organization/package.git#master"

@nickbuddendotcom thanks, I'll try that and upgrade my npm for now.

The main issue is that the shorthand syntax is documented on npm.org as being valid. So if it's in the documentation it needs to work. Or we need to remove it from the documentation and then we can close the bug as well.

I'm fixing some stuff in my codebase today but when I'm done I'm going to investigate this bug again on my end and see if the @npm team has fixed anything related to it.

Member

terinjokes commented Mar 7, 2014

The shorthand syntax is valid, but it doesn't send authentication, as npm doesn't know it. Since this is a private repository, GitHub fails the clone. This isn't a bug with npm.

@terinjokes thank you for this update.

Why does it work prior to npm 1.4.0? What changed?

Just as an FYI I was also able to work-around this issue by specifying the branch with the short-hand ...
"packagename": "Organization/package#master"

Tested on npm 1.4.3

"packagename": "Organization/package" and "packagename": "Organization/package#master" both fail on npm 1.4.9 on Windows because it uses git instead of git+ssh.

Contributor

othiym23 commented Sep 23, 2014

Is this still an issue? We've tweaked a lot around caching git dependencies over the last few months, and I'd like to know if we missed something.

This appears to be working for me. Just did:

npm install Organization/Repository#master

on a private repo and it worked.
npm version

1.4.23

Thanks a bunch for that, guys!

Contributor

othiym23 commented Sep 23, 2014

Great! Closing as resolved!

othiym23 closed this Sep 23, 2014

markstos commented Jan 7, 2015

No, it's still broken. We ran into it today with this combo:

node -v v0.10.33
npm -v 1.4.28

Our package.json syntax was working previously. Now npm fails attempting to use git/ssh instead of https.

markstos commented Jan 7, 2015

Oh, looks like we have a different issue. Basic 'git clone' on my repo suddenly stopped working:

fatal: did not receive expected object d30836d352bdb7a820d58356a49fe9f45e5d6d0e
fatal: index-pack failed

I haven't touched the repo for months. I hope there's not corruption on Github.

Contributor

othiym23 commented Jan 7, 2015

@markstos Also, your version of npm is way old, despite being freshly installed. The latest is npm@2.1.17.

I can install private repositories with: npm install org/repo, but not when they are in the package.json file, neither as org/repo or org/repo#branch. Is this related?
Tried with 2.5.0 and 1.4.28.

Now it gets weird.. I've just realized I've had another (private) repository in the package.json, that has been working for months. I've tried re-cloning the parent project and npm cache clean, but I can't find the difference..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment