量角器无法编译 Typescript 但路径存在
Protractor can't compile Typescript but path exists
我正在 运行Manning "Testing Angular Apps" 书中的第一个量角器示例。
我已经修复了 tsconfig.json 中的一些问题,但 Typescript 仍然无法编译。
显示的错误是
E/launcher - Error: TSError: ⨯ Unable to compile TypeScript:
error TS5058: The specified path does not exist: 'C:/dev/protractor-examples/primerpt/e2e'.
但路径存在。
该示例可以在
https://github.com/pavitx/protractor-examples,克隆后进入primerpt目录
运行
npm install
然后
npm run e2e protractor-first-test.conf.js
为 typescript 和 ts-node 选择的值可能太新了。
以下是有效的值:
{
"name": "protractor-tests",
"scripts": {
"pree2e": "webdriver-manager update --gecko false --standalone false",
"e2e": "protractor"
},
"devDependencies": {
"@types/jasmine": "^2.5.53",
"@types/jasminewd2": "^2.0.2",
"@types/selenium-webdriver": "^3.0.0",
"protractor": "^5.4.2",
"ts-node": "^3.2.0",
"typescript": "^2.3.3"
}
}
使用这些值,测试在 Typescript "transpilation" 之后成功运行。
我正在 运行Manning "Testing Angular Apps" 书中的第一个量角器示例。 我已经修复了 tsconfig.json 中的一些问题,但 Typescript 仍然无法编译。 显示的错误是
E/launcher - Error: TSError: ⨯ Unable to compile TypeScript:
error TS5058: The specified path does not exist: 'C:/dev/protractor-examples/primerpt/e2e'.
但路径存在。 该示例可以在 https://github.com/pavitx/protractor-examples,克隆后进入primerpt目录 运行
npm install
然后
npm run e2e protractor-first-test.conf.js
为 typescript 和 ts-node 选择的值可能太新了。 以下是有效的值:
{
"name": "protractor-tests",
"scripts": {
"pree2e": "webdriver-manager update --gecko false --standalone false",
"e2e": "protractor"
},
"devDependencies": {
"@types/jasmine": "^2.5.53",
"@types/jasminewd2": "^2.0.2",
"@types/selenium-webdriver": "^3.0.0",
"protractor": "^5.4.2",
"ts-node": "^3.2.0",
"typescript": "^2.3.3"
}
}
使用这些值,测试在 Typescript "transpilation" 之后成功运行。