eas login not working

Hello,

I am trying to do “eas login” behind a corporate proxy and it is not working(it simply hangs after asking user username and password). My eas version is : “eas-cli/1.0.0 darwin-x64 node-v18.7.0”

Can anyone please help.

Hi @ranjankhanna

Does your corporate proxy server require a username and password?

If not, try setting the https_proxy environment variable to specify the server and port, something like this:

http://your-proxy-server.host.name:8080/
or
http://192.168.0.1:8080/

(i.e. host name or IP address of the server followed by the port number separated by a colon.)

If you want to avoid going via the proxy for certain hosts, you can also set the no_proxy environment variable to a list of patterns, something like this:

no_proxy="192.168.*,127.*,your-company.com"

See also:

Thanks for the response, yes i have already set the https_proxy and http_proxy env variables. I am able to curl to other websites successfully but “eas login” is not working.

OK, as far as I know that should work. I don’t have a proxy handy, but if I set https_proxy to a non-existent proxy server then it fails as expected:

$ eas --version
eas-cli/1.1.0 linux-x64 node-v16.13.2

Without the bad proxy specified (no error):

$ eas whoami
wodin
$

With the bad proxy specified (error indicates it’s trying to use the proxy):

$ https_proxy=http://127.0.0.1:1234 eas whoami
    CombinedError: [Network] request to https://api.expo.dev/graphql failed, 
    reason: connect ECONNREFUSED 127.0.0.1:1234
$

If you’re on Windows you can test this using npx cross-env ...:

C:\> npx cross-env https_proxy=http://127.0.0.1:1234 eas whoami
    CombinedError: [Network] request to https://api.expo.dev/graphql failed, 
    reason: connect ECONNREFUSED 127.0.0.1:1234
C:\>

I think my proxy settings are correct( i am able to do curl https://api.expo.dev/graphql successfully). And i am not getting ECONNREFUSED error. Is there anything else i can look for to fix the issue.

Sure. I was just thinking that it might be worth verifying that eas is in fact trying to use your proxy settings by temporarily breaking your proxy settings.

I think another thing you could try is setting up Charles proxy and pointing eas at that to see if that gives you any better idea about what’s going wrong. (See the link in my first answer.)

I have upgraded to latest version of eas and now i am getting below error after 5-8 minutes:

prompt>eas login
Log in to EAS
” Email or username ranjankhanna
œ” Password ***************
TypeError: Cannot read property ‘viewer’ of undefined

any idea?

While i am able to login sucessfully if disconnect from corporate VPN