Repository navigation
Running ng e2e throws cannot find definition files (rc0) #5082
Description
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 10
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
@angular/cli: 1.0.0-rc.0
node: 7.6.0
os: win32 x64
@angular/common: 4.0.0-rc.1
@angular/compiler: 4.0.0-rc.1
@angular/core: 4.0.0-rc.1
@angular/forms: 4.0.0-rc.1
@angular/http: 4.0.0-rc.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.1
@angular/platform-browser-dynamic: 4.0.0-rc.1
@angular/router: 4.0.0-rc.1
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 4.0.0-rc.1
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
The project was created viang new -ng4 --routing --styles=scss hello
The log given by the failure.
Normally this include a stack trace and some more information.
webpack: Compiled successfully.
[16:06:50] I/update - chromedriver: file exists C:\Users\achia\workspace\hello\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.27.zip
[16:06:50] I/update - chromedriver: unzipping chromedriver_2.27.zip
[16:06:50] I/update - chromedriver: chromedriver_2.27.exe up to date
[16:06:50] I/launcher - Running 1 instances of WebDriver
[16:06:50] I/direct - Using ChromeDriver directly...
[16:06:53] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'node'. (2688)
e2e\app.e2e-spec.ts (3,1): Cannot find name 'describe'. (2304)
e2e\app.e2e-spec.ts (6,3): Cannot find name 'beforeEach'. (2304)
e2e\app.e2e-spec.ts (10,3): Cannot find name 'it'. (2304)
e2e\app.e2e-spec.ts (12,5): Cannot find name 'expect'. (2304)
at getOutput (C:\Users\achia\workspace\hello\node_modules\ts-node\src\index.ts:312:17)
at C:\Users\achia\workspace\hello\node_modules\ts-node\src\index.ts:343:18
at Object.compile (C:\Users\achia\workspace\hello\node_modules\ts-node\src\index.ts:476:19)
at Module.m._compile (C:\Users\achia\workspace\hello\node_modules\ts-node\src\index.ts:406:44)
at Module._extensions..js (module.js:580:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\Users\achia\workspace\hello\node_modules\ts-node\src\index.ts:409:12)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at C:\Users\achia\workspace\hello\node_modules\jasmine\lib\jasmine.js:87:5
at Array.forEach (native)
at Jasmine.loadSpecs (C:\Users\achia\workspace\hello\node_modules\jasmine\lib\jasmine.js:86:18)
at Jasmine.execute (C:\Users\achia\workspace\hello\node_modules\jasmine\lib\jasmine.js:181:8)
at C:\Users\achia\workspace\hello\node_modules\protractor\built\frameworks\jasmine.js:132:15
at Function.promise (C:\Users\achia\workspace\hello\node_modules\q\q.js:682:9)
at C:\Users\achia\workspace\hello\node_modules\protractor\built\frameworks\jasmine.js:104:14
at _fulfilled (C:\Users\achia\workspace\hello\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\achia\workspace\hello\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\achia\workspace\hello\node_modules\q\q.js:796:13)
at C:\Users\achia\workspace\hello\node_modules\q\q.js:556:49
at runSingle (C:\Users\achia\workspace\hello\node_modules\q\q.js:137:13)
at flush (C:\Users\achia\workspace\hello\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[16:06:53] E/launcher - Process exited with error code 100
Mention any other details that might be useful.
Setting types in e2e/tsconfig.e2e.json to typeRoot pointing to ../node_modules/@types seems resolve the problem.
Thanks! We'll be in touch soon.
Activity
JohannesHoppe commentedon Feb 28, 2017
I can confirm this! 😢
JohannesHoppe commentedon Feb 28, 2017
As @adrianchia already pointed out, this
e2e/tsconfig.e2e.jsonfixes the issue temporarily:this e2e/tsconfig.e2e.json fixes angular/angular-cli#5082 temporarily
hannes-sandahl commentedon Mar 1, 2017
I have the same problem after upgrading from 32.8 to rc.0
@angular/cli: 1.0.0-rc.0
node: 6.9.3
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8
e2e\app.e2e-spec.ts (12,5): Cannot find name 'expect'. (2304)
at getOutput (D:\Git\sok\node_modules\ts-node\src\index.ts:312:17)
at D:\Git\sok\node_modules\ts-node\src\index.ts:343:18
at Object.compile (D:\Git\sok\node_modules\ts-node\src\index.ts:476:19)
at Module.m._compile (D:\Git\sok\node_modules\ts-node\src\index.ts:406:44)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .ts] (D:\Git\sok\node_modules\ts-node\src\index.ts:409:12)
at Module.load (module.js:487:32)
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 D:\Git\sok\node_modules\jasmine\lib\jasmine.js:87:5
at Array.forEach (native)
at Jasmine.loadSpecs (D:\Git\sok\node_modules\jasmine\lib\jasmine.js:86:18)
at Jasmine.execute (D:\Git\sok\node_modules\jasmine\lib\jasmine.js:181:8)
at D:\Git\sok\node_modules\protractor\built\frameworks\jasmine.js:132:15
at Function.promise (D:\Git\sok\node_modules\q\q.js:682:9)
at D:\Git\sok\node_modules\protractor\built\frameworks\jasmine.js:104:14
at _fulfilled (D:\Git\sok\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (D:\Git\sok\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (D:\Git\sok\node_modules\q\q.js:796:13)
at D:\Git\sok\node_modules\q\q.js:556:49
at runSingle (D:\Git\sok\node_modules\q\q.js:137:13)
at flush (D:\Git\sok\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[10:33:23] E/launcher - Process exited with error code 100
doggy8088 commentedon Mar 4, 2017
@filipesilva Do you know why
typeRootsin thesrc/tsconfig.*.jsonbeen removed fromrc.0? This will lead to old project unable to upgrade to newrc.0orrc.1version if they already included some@types.Does the original
typeRootsoption can be default option in the further rc?Also, there is an issue I found today.
#5034 (comment)
filipesilva commentedon Mar 6, 2017
typeRootswas removed in favor of listingtypesindividually because:@types/packagetypeRootsshould default to the correct top-level folderI tried the repo provided and could verify the errors:
This doesn't happen with either
ng buildorng test(which also uses node/jasmine typings), so it makes me think it's related tots-nodewhich is only used in protractor TS compilation. Perhaps inherited path resolution has a bug there.Setting
typeRootson the roottsconfig.jsonseems to fix it for now as well. I'll open a bug onts-node.filipesilva commentedon Mar 6, 2017
I did a bunch of tests and it's not
ts-nodeat all - it'stypescript@~2.2. and also2.3. So as far as I can tell it was an intended change wheretypeRootsis not inferred.I'll put up a PR that adds it to the root
tsconfig.jsonfor--ng4(and thus TS@^2.2) projects.fix(@angular/cli): fix TS2.2 typeroots
filipesilva commentedon Mar 6, 2017
I looked a bit more into it and it might be a
ts-nodebug after all... but only on windows. Tracking it in TypeStrong/ts-node#283fix(@angular/cli): fix TS2.1 typeroots (#5251)
fix(@angular/cli): fix TS2.1 typeroots (angular#5251)
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(@angular/cli): fix TS2.1 typeroots (angular#5251)