각도기 4.0.5에서 Typescript 2.0을 사용하도록 업그레이드 중입니다. 나는 typescript 1.8과 protractor 3.8에서 프로젝트를 업그레이드 중입니다.Typescript 2.0.0이있는 각도기
내 package.json은 다음과 같습니다 :
는{
"dependencies": {
"core-js": "2.2.2",
"rxjs": "5.0.0-beta.6",
"web-request": "^1.0.3",
"zone.js": "0.6.12"
},
"devDependencies": {
"@types/jasmine": "^2.5.35",
"@types/node": "^6.0.45",
"@types/protractor": "^1.5.20",
"@types/selenium-webdriver": "^2.53.33",
"es6-promise": "3.1.2",
"es6-promise-loader": "1.0.1",
"es6-shim": "0.35.0",
"es7-reflect-metadata": "1.6.0",
"exports-loader": "0.6.3",
"imports-loader": "0.6.5",
"jasmine-reporters": "^2.2.0",
"json-loader": "0.5.4",
"mkdirp": "^0.5.1",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "2.1.7",
"pix-diff": "^1.0.14",
"protractor": "4.0.5",
"protractor-jasmine2-html-reporter": "0.0.6",
"protractor-jasmine2-screenshot-reporter": "^0.3.2",
"raw-loader": "0.5.1",
"rimraf": "2.5.2",
"ts-helpers": "1.1.1",
"ts-node": "0.7.1",
"tslint": "3.7.4",
"tslint-loader": "2.1.3",
"typedoc": "0.4.3",
"typescript": "^2.0.0-beta",
"underscore": "^1.8.3"
}
그럼 내 패키지 JSON은 다음과 같습니다
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"lib": ["es6", "dom"],
"types":[
]
},
"exclude": [
"node_modules",
"typings"
],
"filesGlob": [
"./src/**/*.ts",
"!./node_modules/**/*.ts"
],
"awesomeTypescriptLoaderOptions": {
"resolveGlobs": true,
"forkChecker": true,
"compiler": "node_modules/typescript"
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
}
내가 각도기를 실행하려고하면 내가 여기에 공유 문제의 무리 건너왔다 해당 설정으로 테스트를하면 다음과 같은 오류가 발생합니다.
node_modules\@types\selenium-webdriver\index.d.ts (12,11): Duplicate identifier 'Driver'. (2300)
node_modules\@types\selenium-webdriver\index.d.ts (46,11): Duplicate identifier 'Options'. (2300)
node_modules\@types\selenium-webdriver\index.d.ts (310,11): Duplicate identifier 'ServiceBuilder'. (2300)
node_modules\protractor\typings\globals\selenium-webdriver\index.d.ts (12,11): Duplicate identifier 'Driver'. (2300)
node_modules\protractor\typings\globals\selenium-webdriver\index.d.ts (46,11): Duplicate identifier 'Options'. (2300)
node_modules\protractor\typings\globals\selenium-webdriver\index.d.ts (310,11): Duplicate identifier 'ServiceBuilder'. (2300)
어떻게 해결할 수 있습니까? 모든 것이 올바르게 설정되었습니다. 나는 typescript 2.0으로 작업해야하는 각도기 4.0.5를 사용하고 있습니다.
당신이 원인이되는 최소한의'* .ts' 파일을 추가 할 수 있습니다에 대한 https://github.com/suvroc/protractor-typescript-template이
그것은 유용 할 수 있습니다 : 나는
typeRoots
내가 타이프 라이터 2 각도기를 구성하기위한 템플릿을 생성exclude
수정 문제? 각도기에 대해서는 아무 것도 몰라요. 그러나 이것은 타입 정의에 문제가있는 것 같아서 도와 드리려고 노력할 수 있습니다. –@HuyNguyen Ok. 오늘 예제 저장소를 나중에 추가 할 것입니다. –