"量角器测试脚本"没有运行,显示"输入脚本"编译错误消息

时间:2017-10-12 11:17:51

标签: typescript jasmine protractor

最近我安装了#34; ParamMap"包在我的代码中使用此模块。

为此我在命令下面运行

npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save

安装" paramMap" ,当我运行我的e2e文件夹

C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app>ng e2e

显示以下错误

[16:41:41] I/direct - Using ChromeDriver directly...
[16:41:41] I/launcher - Running 1 instances of WebDriver
[16:41:44] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'node'. (2688)
Cannot find type definition file for 'q'. (2688)
Cannot find type definition file for 'selenium-webdriver'. (2688)
e2e\app.e2e-spec.ts (2,38): Cannot find module 'protractor'. (2307)
e2e\app.e2e-spec.ts (3,11): Cannot find name 'require'. (2304)
e2e\app.e2e-spec.ts (5,1): Cannot find name 'describe'. (2304)
e2e\app.e2e-spec.ts (9,3): Cannot find name 'beforeEach'. (2304)
e2e\app.e2e-spec.ts (14,3): Cannot find name 'afterEach'. (2304)
e2e\app.e2e-spec.ts (19,3): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (21,5): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (25,3): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (28,5): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (33,3): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (36,5): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (40,3): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (42,5): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (47,3): Cannot find name 'it'. (2304)
e2e\app.e2e-spec.ts (56,9): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (63,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (66,7): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (71,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (82,9): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (90,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (96,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (105,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (109,7): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (112,7): Cannot find name 'expect'. (2304)
e2e\app.e2e-spec.ts (124,5): Cannot find name 'xit'. (2304)
e2e\app.e2e-spec.ts (135,22): Cannot find name 'Buffer'. (2304)
e2e\app.e2e-spec.ts (139,4): Cannot find name 'it'. (2304)
    at getOutput (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\ts-node\src\index.ts:258:17)
    at C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\ts-node\src\index.ts:267:16
    at Object.compile (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\ts-node\src\index.ts:403:17)
    at loader (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\ts-node\src\index.ts:289:33)
    at Object.require.extensions.(anonymous function) [as .ts] (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\ts-node\src\index.ts:306:14)
    at Module.load (C:\Users\agudla\node_modules\coffee-script\lib\coffee-script\register.js:45:36)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\jasmine\lib\jasmine.js:71:5
    at Array.forEach (native)
    at Jasmine.loadSpecs (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\jasmine\lib\jasmine.js:70:18)
    at Jasmine.execute (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\jasmine\lib\jasmine.js:154:8)
    at C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\built\frameworks\jasmine.js:129:15
    at Function.promise (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:682:9)
    at C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\built\frameworks\jasmine.js:101:14
    at _fulfilled (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:796:13)
    at C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:556:49
    at runSingle (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:137:13)
    at flush (C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\node_modules\protractor\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
[16:41:44] E/launcher - Process exited with error code 100


npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "e2e" "--" "./protractor.conf.js"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! my-app@0.0.0 e2e: `protractor "./protractor.conf.js"`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the my-app@0.0.0 e2e script 'protractor "./protractor.conf.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor "./protractor.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls my-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\agudla\Desktop\Vasundhara\VSCodeWorkspce6\my-app\npm-debug.log

Some end-to-end tests failed, see above.

Can anyone help me how to solve the "Type script" issue.

1 个答案:

答案 0 :(得分:0)

您可以使用NPM以与安装依赖项相同的方式获取类型信息,唯一的区别是您将其保存为开发依赖项,并从@types组织获取它。

例如,Angular的类型定义可以使用:

获得
npm install --save-dev @types/angular

您可以使用Definitely Typed package search搜索包。