dominictarr / npmd

MIT License
450 stars 37 forks source link

Getting errors with the git+ssh:// syntax #33

Open gre opened 10 years ago

gre commented 10 years ago

I'm trying to use npmd install with a git+ssh dependency:

"mymodule": "git+ssh://git@github.com:some/repo.git#sometag"

and it doesn't work and give me that error:

$ npmd install
GET git+ssh://git
Error: incorrect header check
    at Zlib._binding.onerror (zlib.js:295:17)

/usr/local/share/npm/lib/node_modules/npmd/index.js:129
      if(err) throw err
                    ^
Error: incorrect header check
    at Zlib._binding.onerror (zlib.js:295:17)
dominictarr commented 10 years ago

this is an issue is this

https://github.com/dominictarr/npmd-git-resolve

currently, this only supports github git repos, and it turns git into a tarball download. you just need to update the regular expression, here:

https://github.com/dominictarr/npmd-git-resolve/blob/master/index.js#L19

and add a test here:

https://github.com/dominictarr/npmd-git-resolve/blob/master/test/download.js#L19

can you make a pull request?

gre commented 10 years ago

Sounds good, I'll try to provide a PR asap, thanks

gre commented 10 years ago

Hi Dominic,

I've fixed it to support the alternative syntax, however the fact that it only support Github public repository is limiting for my use-case. I hope private repository will be supported by npmd in the future.

Is there any way why the npm resolver can't be used? Otherwise using npm as a backup for some unresolvable packages would be fine for me.

Thanks, gre

dominictarr commented 10 years ago

Sure, you could have a command than shells out to git, then bundles the package to make it installable. I'd gladly take a pull request to add this, but it is not a issue that is high on my priority list, personally.

It would be pretty similar to what I have in npmd-git-resolve already, it would just shell out to a git clone instead of downloading the tarball.