Apm: Installing package from SSH Git URL doesn't work

Created on 5 Jun 2018  Â·  7Comments  Â·  Source: atom/apm

Prerequisites

Description

Despite of what https://github.com/atom/apm/pull/518 says, installing a package from an SSH URL (git@...) doesn't work.

(Sidenote: I couldn't find any documentation for the "Install package from Git URL" feature.)

Steps to Reproduce

  1. Develop a package on master branch of a GitHub Enterprise repo
  2. Run apm install --verbose [email protected]:myorg/mypackage.git

Expected behavior: [What you expect to happen]

Package is installed successfully.

Actual behavior: [What actually happens]

From what I can tell, apm misinterprets git@... as package@version and hence tries to resolve package git from atom.io:

Installing [email protected]:myorg/mypackage.git to /Users/xxx/.atom/packages
REQUEST { url: 'https://atom.io/api/packages/git', ... }
REQUEST make request https://atom.io/api/packages/git
REQUEST onRequestResponse https://atom.io/api/packages/git 404
...
Request for package information failed: Not Found

Reproduces how often: [What percentage of the time does it reproduce?]

always

Versions

apm 1.19.0
npm 3.10.10
node 6.9.5 x64
atom 1.27.2
python 2.7.10
git 2.17.1

macOS 10.13.5

Additional Information

I also tried with ssh:// and git+ssh:// URLs but the problem remains the same.

blocked help-wanted

Most helpful comment

Any updates? Are there any plans to support/fix installing packages from Git URLs?

All 7 comments

Unfortunately, because we use hosted-git-info for a vital part of this functionality, installing packages using Git URLs only works for repositories hosted on GitHub, BitBucket, and GitLab.

See: https://www.npmjs.com/package/hosted-git-info#supported-hosts.

@thomasjo You mean github/bitbucket/gitlab.com? (The package is hosted on GitHub Enterprise.) Ouch. In that case, can hosted-git-info be replaced/fixed/forked?

Sounds like we are waiting for this PR to land: https://github.com/npm/hosted-git-info/pull/30

@fcurts Yeah, that PR is quite old, and sadly there seems to be very little activity on the repo. Our recommendation for the time being is that you switch from using git@... to https:// URLs, which should work as expected.

Because this is currently blocked upstream, and there is a viable workaround, I'm going to close this. If using the proposed workaround will cause major problems for you, let us know and we can re-open the issue. If you, or someone else is willing to contribute a PR that resolves the problem, with zero regressions in existing functionality, we might be able get that merged and shipped.

Thanks for the report, and sorry about the inconvenience.

@thomasjo HTTPS has the same problem - apm tries to resolve a package named https://github.mycompany.com/myorg/mypackage.git from atom.io. And even if it worked, many on-premises GitHub/GitLab instances (including ours) only support SSH Git URLs.

Please re-open.

Any updates? Are there any plans to support/fix installing packages from Git URLs?

For now manually cloning and then installing with apm is probably the easiest way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dallyingllama picture dallyingllama  Â·  5Comments

lexicalunit picture lexicalunit  Â·  9Comments

izuzak picture izuzak  Â·  5Comments

steelbrain picture steelbrain  Â·  10Comments

michaelsanford picture michaelsanford  Â·  4Comments