Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

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

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

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

framerate opened this issue Feb 20, 2014 · 14 comments

Comments

@framerate
Copy link

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

@framerate
Copy link
Author

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

@nickbuddendotcom
Copy link

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"

@framerate
Copy link
Author

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

@terinjokes
Copy link
Contributor

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.

@framerate
Copy link
Author

@terinjokes thank you for this update.

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

@SciencePiggy
Copy link

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

@sheymann
Copy link

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

@othiym23
Copy link
Contributor

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.

@framerate
Copy link
Author

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!

@othiym23
Copy link
Contributor

Great! Closing as resolved!

@markstos
Copy link

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
Copy link

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.

@othiym23
Copy link
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.

@tjconcept
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants