Angular 角度客户端e2e:错误:连接ETIMEDOUT

Angular 角度客户端e2e:错误:连接ETIMEDOUT,angular,testing,command-line-interface,angular-e2e,Angular,Testing,Command Line Interface,Angular E2e,我无法在使用CLI创建的全新香草项目上运行$ng e2e: $ ng e2e ** NG Live Development Server is listening on localhost:49155, open your browser on http://localhost:49155/ ** Date: 2018-04-17T08:42:39.992Z Hash: 42744fd16a957b054ef8 Time: 6402ms chunk {inline} inline.bundle.

我无法在使用CLI创建的全新香草项目上运行
$ng e2e

$ ng e2e
** NG Live Development Server is listening on localhost:49155, open your browser on http://localhost:49155/ **
Date: 2018-04-17T08:42:39.992Z
Hash: 42744fd16a957b054ef8
Time: 6402ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 3.89 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 8.22 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 205 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 14.5 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.76 MB [initial] [rendered]
(node:12752) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

webpack: Compiled successfully.
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 216.58.206.144:443
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
  • 听起来像是端口问题:我将端口从4200更改为
    gragrator.conf.js
    (baseUrl)中的其他端口,只是为了确保这个端口不忙。同样的结果
  • 我不确定这是否与我支持一个代理有关?虽然错误听起来不像那样<代码>代理和
    https代理
    在npm配置中发送,npm本身能够通信
一些版本提示:

Angular CLI: 1.7.4
Node: 8.10.0
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
量角器配置(由CLI创建):


有什么想法吗?

好的,在进一步深入研究之后,我发现
nge2e
将在内部调用
webdriver manager update
——但这一次失败,因为缺少代理设置。不过,当我设置它运行正常时,它尊重
HTTPS\u PROXY
env变量。在这里找到了答案:

窗口:
set HTTPS\u PROXY=http://:''@xxx.xxx.xxx.xxx:xxxx

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './e2e/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: 'e2e/tsconfig.e2e.json'
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};