-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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 create" failing behind a proxy #1009
Comments
I'm getting the same error
We are behind a proxy and we are using Proget internally to manage our npm packages. Does vue-cli take these npm settings into account? We can not use any environment variables as they will interfere with other tools. The
more info on the no-proxy setting in npm: npm/npm#19157 |
the same error occurs to me. My cli version is
My
|
Have you tried to set proxy variables with global flag and not on user profile?
|
Having the same exact problem. Did not experience this just 7 days ago, also w/ cli 3.0. I have configured the proxy and npm itself is fine, it's just vue-cli Update: uninstalled node, reinstalled, reconfigured proxy (w/ global flag), npm installed, and still the issue persists. Windows 10 and Server 2012 both. |
Here's a workaround.
|
@stephanerotureau, sorry for the delayed reply (Easter holidays). I have now tried the global proxy setup, but alas it still fails with the same error.
|
Thanks @cyborg29, your work around works :) Is there a generic fix that could be applied to utilise the configured npm proxy? Perhaps using the npm package? I spent a few hours investigating but couldn't work it out. For what it's worth, here's a snippet. var npm = require("npm")
npm.load({}, function() {
npm.get('proxy')
}) Or perhaps store the needed (template?) files as an npm package, e.g. vue-cli-templates? |
Many thanks, @cyborg29. Glad to be up and running again! It would be nice if the CLI had a flag to pass in a proxy, or a configuration command to set a persistent proxy, or any other built-in solution. |
If you want to hack the cli, there is also an another solution like below: |
For me it worked in Powershell like this:
Hint was in
|
In my situation, it will cause other problems (like other application's web connetion) if i set system global proxy. |
i had to do this: const request = require('request-promise-native')
module.exports = {
async get(uri) {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
const reqOpts = {
method: 'GET',
resolveWithFullResponse: true,
json: true,
uri,
proxy: 'http://proxy:123'
}
return request(reqOpts)
}
} |
Thanks @yyx990803 for #b1512be to allow a proxy to specified on the commandline. As a convenience, have you considered using the npm configured proxy as the default proxy for vue-cli so it doesn't need to be specified on every use? |
No because it picks up proxy set via environment variables automatically. This is only meant as an escape hatch for those who can't / don't want to use environment variables for whatever reason. |
@yyx990803 Thanks!
and
and
but none of them worked. |
you can set http_proxy environment variables but you also have to set proxy for npm. To figure out if this is true, you can try yarn. if it works then you should try the above.
|
I cannot find anywhere that references how we are to use a specific proxy with the --proxy flag. Does anybody know? |
I don't know why you need a proxy, however if you are like me in China, by setting the following ~/.vuerc may help. {
"useTaobaoRegistry": true,
"packageManager": "yarn"
} |
Version
3.0.0-beta.6
Reproduction link
https://github.com/
Steps to reproduce
Create a vue project on a PC behind a firewall.. vue create dummyProject
What is expected?
Prompt for information and then create a webpack project
What is actually happening?
Pauses 5-10s and then returns following error stack..
ERROR RequestError: Error: connect ETIMEDOUT 151.101.104.162:443 RequestError: Error: connect ETIMEDOUT 151.101.104.162:443 at new RequestError (C:\Users\tabtis\AppData\Roaming\npm\node_modules@vue\cli\node_modules\request-promise-core\lib\errors.js:14:15) at Request.plumbing.callback (C:\Users\tabtis\AppData\Roaming\npm\node_modules@vue\cli\node_modules\request-promise-core\lib\plumbing.js:87:29) at Request.RP$callback [as _callback] (C:\Users\tabtis\AppData\Roaming\npm\node_modules@vue\cli\node_modules\request-promise-core\lib\plumbing.js:46:31) at self.callback (C:\Users\tabtis\AppData\Roaming\npm\node_modules@vue\cli\node_modules\request\request.js:186:22) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Request.onRequestError (C:\Users\tabtis\AppData\Roaming\npm\node_modules@vue\cli\node_modules\request\request.js:878:8) at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) at TLSSocket.socketErrorListener (_http_client.js:387:9)
Likely related to #785 and #258 (both closed).
I am 99% sure my npm firewall setup is correct since "npm intall" works fine.
If there's no fix, is there a workaround similar to #258 where the template repo can't be cloned and referenced to create a vue-cli v3 styled project?
The text was updated successfully, but these errors were encountered: