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

vue configuration when behind proxy #258

Closed
tomvdk opened this issue Dec 6, 2016 · 16 comments
Closed

vue configuration when behind proxy #258

tomvdk opened this issue Dec 6, 2016 · 16 comments

Comments

@tomvdk
Copy link

tomvdk commented Dec 6, 2016

Hi,

We are having lots of trouble configuring the vue-cli. We are behind a proxy and get the following error when installing a template:

vue-cli · Failed to download repo vuejs-templates/simple: unable to verify the first certificate

We think this is due to our proxy and misconfiguration of our gitconfig. Also, our proxy has a certificate configured. Does anyone know, how to troubleshoot this because I find this very cumbersome.

Our .gitconfig file looks like this:

# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = myusername
email = [email protected]
[http] 
sslVerify = false 
	proxy = http://<username>:<password>@<proxy>:8080
[https] 
[url "https://github.com/"]
insteadOf = git://github.com/

Thanks a lot in advance.

@posva
Copy link
Member

posva commented Dec 9, 2016

It has actually nothing to do with your gitconfig. Your proxy is actually an insecure man in the middle... Not verifying the ssl certificate is a bad idea.

To debug further this problem you should check https://github.com/flipxfx/download-git-repo/blob/master/package.json and its dependencies. That's what vue-cli uses under the hood to fetch the template

@tomvdk
Copy link
Author

tomvdk commented Dec 9, 2016

Thanks a lot for pointing this out. I'll investigate the dependencies.

@Akryum
Copy link
Member

Akryum commented Dec 12, 2016

download-git-repo should allow passing options to download/got so we could use these proxy settings.

@Jecoms
Copy link

Jecoms commented Dec 20, 2016

I'm able to clone from git manually, but when trying to vue init a template, I get "unable to get local issuer certificate." I've already added our cert similar to this vscode/git issue method and I've added our proxy in the config for node/git.

Is there an avenue to config vue-cli or the under-the-hood download-git-repo to cooperate with our proxy?

@traeblain
Copy link

For anyone still having issues with this here's a band-aid fix:

git clone https://github.com/vuejs-templates/simple ~/.vue-templates/simple
vue init simple my-project --offline
cd my-project
npm install
npm run dev

So like the commenters git works fine by itself, so clone the template you want into your HOME/.vue-templates folder, then use the --offline switch to skip the non-functioning git clone that vue-cli uses. Then npm install works just fine and you are ready to go.

(NOTE: If you are on Windows machine using cmd, you'll need to change your folder commands appropriately.)

@niallobrien
Copy link

@traeblain Thanks for sharing.
Windows example: git clone https://github.com/nuxt-community/starter-template.git C:\Users\niallobrien\.vue-templates\nuxt-starter-template - just swap out the username for example

@grunlowen2
Copy link

Thanks! Worked for me on my corporate Windows machine. Had to set some env variables, like HTTPS_PROXY to point at our proxy server, but after that it worked.

@artzub
Copy link

artzub commented Dec 9, 2017

Maybe it will be useful someone

npm_config_strict_ssl=false vue init webpack my-project

@kreig303
Copy link

kreig303 commented Feb 6, 2018

@yyx990803 not sure why you're closing this out... it is an issue that is not resolved. The workaround @traeblain specifies is the only method for some of us using corp proxies with man-in-the-middle certs.

@yyx990803
Copy link
Member

@kreig303 unfortunately, we will no longer be adding new features to vue-cli 2.x. We will try to address this if the similar issue persists in 3.0.

@xjojoramirez
Copy link

xjojoramirez commented Mar 1, 2018

hi @traeblain, where can I find the HOME/.vue-templates folder? or anyone knows.

@traeblain
Copy link

@MojoeJoJo you may have to create it, or let git create it when you clone.

If you are on Linux create ~\.vue-templates if you are on Windows create C:\Users\USER\.vue-templates where USER is specific to your user folder.

@netqyq
Copy link

netqyq commented Mar 2, 2018

this works

git clone https://github.com/vuejs-templates/webpack ~/.vue-templates/webpack
vue-init --offline webpack nongcaiyuan-front
cd my-project
npm install
npm run dev

@Gargo
Copy link

Gargo commented Jul 15, 2018

In my case helped a strange solution - I updated git and disabled Kaspersky mall Office Security (I work on windows)

@charlesx163
Copy link

@traeblain

For anyone still having issues with this here's a band-aid fix:

git clone https://github.com/vuejs-templates/simple ~/.vue-templates/simple
vue init simple my-project --offline
cd my-project
npm install
npm run dev

So like the commenters git works fine by itself, so clone the template you want into your HOME/.vue-templates folder, then use the --offline switch to skip the non-functioning git clone that vue-cli uses. Then npm install works just fine and you are ready to go.

(NOTE: If you are on Windows machine using cmd, you'll need to change your folder commands appropriately.)

this works

@felix-cao
Copy link

this works

git clone https://github.com/vuejs-templates/webpack ~/.vue-templates/webpack
vue-init --offline webpack nongcaiyuan-front
cd my-project
npm install
npm run dev

This works

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

No branches or pull requests