Transporter connection error - Angular CLI

I have built an Angular 4 project using Angular CLI and am trying to run Protractor

default tests using the command ng e2e

. When I run it, I initially get a successful compilation, but then after about 20 seconds, no matter what I do anything, I get this error in my terminal:

events.js: 160 throw er; // Unhandled 'error' event

Error: Connect ETIMEDOUT 172.217.10.80:443 to Object.exports._errnoException (util.js: 1018: 11) to export._exceptionWithHostPort (util.js: 1041: 20) to TCPConnectWrap.afterConnect [as incomplete] (net .js: 1086: 14)

In my Chrome console, I am getting this error:

zone.js: 2616 GET http: // localhost: 49155 / sockjs-node / info? t = 1501623806543 net :: ERR_CONNECTION_REFUSED

I don't have this problem with my "regular" project on port 4200.

+2


source to share


2 answers


@ecain,

When you execute ng e2e

it runs the command webdriver-manager update

and it downloads the webdriver dependency from the net. In your case, it was blocked on the network. You can try setting proxy in protractor.conf.js like below:

capabilities: {
'browserName': 'chrome',
'proxy': {
'proxyType': 'manual',
'httpProxy': 'http://proxy.abc.com:8080'}

      



If this will work in your case, you can see the output as shown below when run ng e2e

in the console

webpack: Compiled successfully.
[19:46:41] I/update - chromedriver: unzipping chromedriver_2.33.zip
[19:46:41] I/launcher - Running 1 instances of WebDriver
[19:46:41] I/direct - Using ChromeDriver directly...

DevTools listening on ws://127.0.0.1:12629/devtools/browser/01b4e971-94f1-
484a-87bc-ec9f41f30959
Jasmine started

      

If the above solution doesn't work, set the proxy in the system environment variable with the key http_proxy

and remove the proxy from the inside npm

if it is set globally. The command to remove the proxy inside npm

is:npm config delete proxy

0


source


You must be able to set environment variables to allow downloads through a corporate proxy:

 SET https_proxy=http://www-proxy.corporate.com:80 *
 SET http_proxy=http://www-proxy.corporate.com:80 *

      

In addition, this approach is more convenient if you need to provide credentials for the proxy server, for example:



SET https_proxy = http: // yourUserName: your password @ www-proxy.corporate.com: 80

  • Remember to replace http://www-proxy.corporate.com:80 with your actual proxy value. This is a temporary fix because it can be reset when you restart your computer. For a more permanent approach, you can follow the instructions at this link:

Can't run Angular> 2 e2e using protractor behind proxy

0


source







All Articles