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
Yarn ignores no_proxy environment variable when proxy property set #5048
Comments
Yes. This happens because the env vars However, There is some discussion of this behavior here request/request#1195 and it looks like NPM tackled the same issue at some point. A workaround would be to set your proxies as env vars instead of in yarn config. |
Thanks for your answer. |
npm (5.8.0-next.0) just merged the no-proxy setting in .npmrc: npm/npm#19157 |
tagging this as a feature request to add a |
Please review my pull request to add no-proxy support for config file: #5757 |
What is the status of this feature? I have CI/CD that has to use proxy to communicate with cluster and yarn is blocking me since it fails to install packages. |
The reviewer seems to have another understanding of the problem. For us, we solved it by removing proxy settings from .yarnrc file but providing them with environment variables only instead.
(HTTP_PROXY, HTTPS_PROXY, no_proxy)
|
Hello, Our organization blocks the intranet url requests through proxy. It is mandatory for us to use In our case, we are hosting an internal registry and I need to download some packages from internet using proxy and some from internet as needed. When I set proxy in yarn config, requests to our internal registries are blocked and if I remove proxy settings, I can't download other yarn packages from internet. Any help / pointers / workaround is appreciated. EDIT: as suggested in the above comment by rally25rs, removing proxy settings from yarn config and having them in shell helped. |
On my company side, as we work with multiple projects in same time, it is forbidden to play with global env var. Everything must be under the project folder. The glaussmickael seems to cover the need. Or if you prefer an official solution you can ask to request to support the option (see this discussion request/request#3122) that will simplify the PR. In current state it is not possible to yarn to be compatible with npm... |
I've created a PR for request that will add the support of noProxy option here. |
This is an exact reason why I cannot use yarn in my working environment. Some of modules I need to take from the external resources - some from internal. Only by disabling proxy settings for specific domains I can resolve my issue in yarn. Really - npm is not that bad in this case. |
Hello, Any option to avoid that ? Maybe accelerate review/acceptation ? |
My PR is for one of the yarn dependencies (request). Until it is approved, nothing can be done in yarn :-( |
Request lib seems in maintenance only mode. No new enhancement will be accepted... Yarn need to process itself the address to pass or not the proxy option to request. |
As environment variables do not work anymore (since yarn 1.9), I was forced to come up with different workaround. On unix based system (I used alpine in docker), one can utilize proxychains-ng to handle proxies outside of yarn altogether. Very simplified proxyconfig.conf:
Then run yarn with this command (argument -q is important - does not work without it): |
I found a workaround if you need to connect to private npm registry by config proxy and you have
PROXY=http://proxy.company.com:80
NO_PROXY=".company.com"
export PROXY=$PROXY
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export NO_PROXY=$NO_PROXY
https-proxy=http://proxy.company.com:80/
proxy=http://proxy.company.com:80/
no-proxy=.company.com
https-proxy ""
proxy "" There is the trick
Then both your |
Woaw this is tricky. Will try it asap |
The problem with setting PROXY and NO_PROXY env variables is that other tools, like for example Visual Studio, also pick these up. |
Did the above trick solved the issue? |
@walter-heestermans-toyota I can confirm this setup worked for me. |
Looks like a great opportinity to support |
one question: there's still my PR open in request package, that is unmaintained now. IN this case noProxy option can be officially supported. |
how to solve this issue? |
Another way of doing this is to export the following environment variables: export YARN_PROXY=""
export YARN_HTTPS_PROXY="" This works very well in build pipelines where HTTP_PROXY, HTTPS_PROXY and NO_PROXY are set by default. |
But in case of no environment car at all, any solution ? |
5 years later...any chance this issue will get resolved? |
My requests or has been approved 2 days ago but still not merged. |
Do we have update on this ? |
@paztis What do you mean by that? |
Do we know if @jk195417's workaround still works now? |
@erict-square It worked for me :) |
hi folks 👋🏼 based on this workaround, has anyone tried passing |
Do you want to request a feature or report a bug?
Both
What is the current behavior?
If
proxy
andhttp-proxy
are set,NO_PROXY
andno_proxy
environment variables are ignored.If the current behavior is a bug, please provide the steps to reproduce.
proxy
andhttps-proxy
config and can find fromyarn config list
NO_PROXY
orno_proxy
environment variable like$ no_proxy="some.url.private.repo"
yarn install
proxy
andhttps-proxy
work butno_proxy
environment variable is ignored.What is the expected behavior?
NO_PROXY
orno_proxy
environment variable is applied.Please mention your node.js, yarn and operating system version.
Ubuntu 16.04
yarn 1.3.2
The text was updated successfully, but these errors were encountered: