2017-07-14 58 views
0

我已經使用角度cli創建了一個新項目並將browser.pause();命令添加到默認規格。但是,如果我運行測試,量角器不會停止。相反,我在控制檯中收到以下消息:Angular 4.0 e2e測試 - 無法暫停量角器

Error: Cannot find module '_debugger' 
    at Function.Module._resolveFilename (module.js:485:15) 
    at Function.Module._load (module.js:437:25) 
    at Module.require (module.js:513:17) 
    at require (internal/module.js:11:18) 
    at Object.<anonymous> (C:\Projects\sample\node_modules\protractor\built\debugger 
\debuggerCommons.js:1:82) 
    at Module._compile (module.js:569:30) 
    at Object.Module._extensions..js (module.js:580:10) 
    at Module.load (module.js:503:32) 
    at tryModuleLoad (module.js:466:12) 
    at Function.Module._load (module.js:458:3) 

是否需要安裝某些軟件包或某些配置選項丟失或其他內容?

UPDATE

這裏是package.json內容:

{ 
    "name": "sample", 
    "version": "0.0.0", 
    "license": "MIT", 
    "scripts": { 
    "ng": "ng", 
    "start": "ng serve", 
    "build": "ng build", 
    "test": "ng test", 
    "lint": "ng lint", 
    "e2e": "ng e2e" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/animations": "^4.0.0", 
    "@angular/common": "^4.0.0", 
    "@angular/compiler": "^4.0.0", 
    "@angular/core": "^4.0.0", 
    "@angular/forms": "^4.0.0", 
    "@angular/http": "^4.0.0", 
    "@angular/platform-browser": "^4.0.0", 
    "@angular/platform-browser-dynamic": "^4.0.0", 
    "@angular/router": "^4.0.0", 
    "core-js": "^2.4.1", 
    "rxjs": "^5.1.0", 
    "zone.js": "^0.8.4" 
    }, 
    "devDependencies": { 
    "@angular/cli": "1.2.0", 
    "@angular/compiler-cli": "^4.0.0", 
    "@angular/language-service": "^4.0.0", 
    "@types/jasmine": "~2.5.53", 
    "@types/jasminewd2": "~2.0.2", 
    "@types/node": "~6.0.60", 
    "codelyzer": "~3.0.1", 
    "jasmine-core": "~2.6.2", 
    "jasmine-spec-reporter": "~4.1.0", 
    "karma": "~1.7.0", 
    "karma-chrome-launcher": "~2.1.1", 
    "karma-cli": "~1.0.1", 
    "karma-coverage-istanbul-reporter": "^1.2.1", 
    "karma-jasmine": "~1.1.0", 
    "karma-jasmine-html-reporter": "^0.2.2", 
    "protractor": "~5.1.2", 
    "ts-node": "~3.0.4", 
    "tslint": "~5.3.2", 
    "typescript": "~2.3.3" 
    } 
} 
+0

請問您可以添加您的package.json嗎? – Supamiu

+0

已添加。基本上它是由Angular CLI生成的默認'package.json',沒有任何修改 – Random

回答