Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails behind corporate proxy (SSH block?) #132

Closed
brownieboy opened this issue May 9, 2017 · 16 comments
Closed

Install fails behind corporate proxy (SSH block?) #132

brownieboy opened this issue May 9, 2017 · 16 comments

Comments

@brownieboy
Copy link

brownieboy commented May 9, 2017

Do you want to request a feature or report a bug?
Feature request.

What is the current behavior?
Global install npm install -g webpack-cli fails behind a corporate proxy. Error is:

Error: Command failed: git -c core.longpaths=true config --get remote.origin.url

I suspect that this is because our corporate proxy blocks SSH access to the internet (as many of them do).

What is the expected behavior?
Install should not crash like this simply because SSH is unavailable.

If this is a feature request, what is motivation or use case for changing the behaviour?
We need an option to have the installer to execute its git clone tasks via HTTPS instead of SSH. At the very least, the installer should trap this error and tell the user what the problem is.

Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.
Windows 7, but it also happened on a Linux Mint VM behind the same corporate proxy.

@evenstensberg
Copy link
Member

If you're cloning this instead of downloading directly, you can use https. Other than that, you can also download the source and run npm link within your shell to get the same behaviour as npm install -g webpack-cli. Did this help? :) Happy to elaborate!

@brownieboy
Copy link
Author

brownieboy commented May 9, 2017

Thanks for that very quick response, @ev1stensberg .

I've not used npm link before, but when I tried it I got the same error. My exact command steps were:

npm remove webpack-cli -g
git clone https://github.com/webpack/webpack-cli.git
cd webpack-cli
npm link

That seemed to kick the install process off again, eventually resulting in the same error.

Actually, the repository that seems to be triggering the error is git://github.com/kalcifer/recast.git. So maybe I need to clone that one (too)?

@evenstensberg
Copy link
Member

It may be. You can change the package.json in the forked version to https, and it should in theory work for your case. Note that recast isn't the only forked repo, but also Yeoman-Generator.

https://coderwall.com/p/q_gh-w/fork-and-patch-npm-moduels-hosted-on-github

Also, I think you should use npm uninstall webpack-cli -g instead, remove isn't a valid command, is it?

npm link is a symlink that will allow you to execute the clone from any directory. Happy to help!

@evenstensberg
Copy link
Member

Also a note to add is that we're removing these forks soon. For your SSH problems ->
http://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly

@brownieboy
Copy link
Author

Thanks again, @ev1stensberg.

I think I'll wait until you've removed the forks from the installer.

FYI, remove is a valid alias to uninstall, see https://docs.npmjs.com/cli/uninstall. I should probably use the proper command though!

@evenstensberg
Copy link
Member

Oooh, nitty! No need to wait, I think this is doable. Either do as in below picture and do npm link, or you could try out the SO link I've commented.

skjermbilde 2017-05-10 kl 01 19 41

@brownieboy
Copy link
Author

brownieboy commented May 10, 2017

Thanks again. That got me a bit further, but I've hit new problems.

I was able to install webpack-cli using the npm link method. But trying to execute like so:

webpack-cli init webpack-addons-testcli

failed with the error

TypeError: Package isn't registered on npm.

No indication as to which package this is.

Also, the installation of webpack-cli caused some of my other globally installed packages to throw the error:

npm ERR! extraneous:

when I try to list them with an npm list -g --depth=0. This error went away when I uninstalled webpack-cli.

Thanks for your help, so far, but this is all getting a bit messy. I'd rather wait until you've removed the forks from the installer as you said.

@ghost
Copy link

ghost commented May 10, 2017

Possibly setting this option could help:

> git config --global url."https://".insteadOf git://

~/.gitconfig

[url "https://"]
insteadOf = git://

@TheLarkInn
Copy link
Member

@brownieboy Let me know if @dkfiresky 's suggestion was helpful or if we need to assist any further.

@anyulled
Copy link

anyulled commented May 23, 2017

@dkfiresky I'm having the same error nad tried your suggestion and it worked, thanks a lot.

@evenstensberg
Copy link
Member

Can you send me your .gitconfig per mail @anyulled ? See patterns of this issue on windows, need some context around npm. Should work at our end.

@anyulled
Copy link

@ev1stensberg my .gitconfig only has this now:

[user]
name = alrs
email = [email protected]
[url "https://"]
insteadOf = git://

@evenstensberg
Copy link
Member

Can I get yours as well @brownieboy ?

@evenstensberg
Copy link
Member

Any update on this?

@evenstensberg
Copy link
Member

This is probably a dupe of #182, so let's resume discussion over there!

@ghost
Copy link

ghost commented Dec 19, 2017

@ev1stensberg it's actually vise versa since this ticket was created earlier :)

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

No branches or pull requests

4 participants