Angular-cli: ng e2e - not able to find type definition files and modules after uprading from 4.2.6 to 4.3

Created on 19 Jul 2017  Â·  9Comments  Â·  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions

@angular/cli: 1.2.1
node: 6.10.0
os: win32 x64
@angular/animations: 4.3.0
@angular/cdk: 2.0.0-beta.8-03c0087
@angular/common: 4.3.0
@angular/compiler: 4.3.0
@angular/core: 4.3.0
@angular/forms: 4.3.0
@angular/http: 4.3.0
@angular/material: 2.0.0-beta.8-03c0087
@angular/platform-browser: 4.3.0
@angular/platform-browser-dynamic: 4.3.0
@angular/platform-server: 4.3.0
@angular/router: 4.3.0
@angular/cli: 1.2.1
@angular/compiler-cli: 4.3.0

Repro steps

  • Update from 4.2.6 to 4.3 or just create a new blank project
  • Run ng e2e
  • Boom, failure

The log given by the failure.

PS C:\Projects\Visual Studio\<...>> ng e2e
** NG Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152 **
Hash: c9285aa3b26a466c17ce
Time: 56108ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 90.7 kB {1} {2} {3} {4} {5} {6} {7} {8} {9} {11} [rendered]
chunk    {1} 1.chunk.js, 1.chunk.js.map 57.4 kB {0} {2} {3} {4} {5} {6} {7} {8} {9} {11} [rendered]
chunk    {2} 2.chunk.js, 2.chunk.js.map 20.5 kB {0} {1} {3} {4} {5} {6} {7} {8} {9} {11} [rendered]
chunk    {3} 3.chunk.js, 3.chunk.js.map 6.17 kB {0} {1} {2} {4} {5} {6} {7} {8} {9} {11} [rendered]
chunk    {4} 4.chunk.js, 4.chunk.js.map 2.46 kB {0} {1} {2} {3} {5} {6} {7} {8} {9} {11} [rendered]
chunk    {5} 5.chunk.js, 5.chunk.js.map 2.47 kB {0} {1} {2} {3} {4} {6} {7} {8} {9} {11} [rendered]
chunk    {6} 6.chunk.js, 6.chunk.js.map 2.5 kB {0} {1} {2} {3} {4} {5} {7} {8} {9} {11} [rendered]
chunk    {7} 7.chunk.js, 7.chunk.js.map 2.49 kB {0} {1} {2} {3} {4} {5} {6} {8} {9} {11} [rendered]
chunk    {8} 8.chunk.js, 8.chunk.js.map 2.48 kB {0} {1} {2} {3} {4} {5} {6} {7} {9} {11} [rendered]
chunk    {9} 9.chunk.js, 9.chunk.js.map 2.48 kB {0} {1} {2} {3} {4} {5} {6} {7} {8} {11} [rendered]
chunk   {10} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 408 kB {15} [initial] [rendered]
chunk   {11} main.bundle.js, main.bundle.js.map (main) 169 kB {14} [initial] [rendered]
chunk   {12} styles.bundle.js, styles.bundle.js.map (styles) 661 kB {15} [initial] [rendered]
chunk   {13} scripts.bundle.js, scripts.bundle.js.map (scripts) 2.26 MB {15} [initial] [rendered]
chunk   {14} vendor.bundle.js, vendor.bundle.js.map (vendor) 5.13 MB [initial] [rendered]
chunk   {15} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[15:14:28] I/update - chromedriver: file exists C:\Projects\Visual Studio\<...>\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.30.zip
[15:14:28] I/update - chromedriver: unzipping chromedriver_2.30.zip
[15:14:28] I/update - chromedriver: chromedriver_2.30.exe up to date
[15:14:28] I/launcher - Running 1 instances of WebDriver
[15:14:28] I/direct - Using ChromeDriver directly...
[15:14:32] 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 (1,35): Cannot find module './app.po'. (2307)
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:\Projects\Visual Studio\<...>\node_modules\ts-node\src\index.ts:300:15)
    at C:\Projects\Visual Studio\<...>\node_modules\ts-node\src\index.ts:330:16
    at Object.compile (C:\Projects\Visual Studio\<...>\node_modules\ts-node\src\index.ts:489:17)
    at Module.m._compile (C:\Projects\Visual Studio\<...>\node_modules\ts-node\src\index.ts:382:43)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .ts] (C:\Projects\Visual Studio\<...>\node_modules\ts-node\src\index.ts:385: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 C:\Projects\Visual Studio\<...>\node_modules\jasmine\lib\jasmine.js:93:5
    at Array.forEach (native)
    at Jasmine.loadSpecs (C:\Projects\Visual Studio\<...>\node_modules\jasmine\lib\jasmine.js:92:18)
    at Jasmine.execute (C:\Projects\Visual Studio\<...>\node_modules\jasmine\lib\jasmine.js:197:8)
    at C:\Projects\Visual Studio\<...>\node_modules\protractor\built\frameworks\jasmine.js:132:15
[15:14:32] E/launcher - Process exited with error code 100

Desired functionality

  • It should run the tests like before when using Angular 4.2.6 or display at least detailed issues on referenced files

Mention any other details that might be useful.

It says Angular CLI is not able to resolve files although Visual Studio Code finds references on them without issues. All npm packages are up to date and no huge changes were made before uprading to 4.3.

Most helpful comment

This is a problem with ts-node, if you upgrade to ts-node@latest you should be fine.

All 9 comments

for me it works.

@angular/cli: 1.2.1
node: 6.11.1
os: win32 x64
@angular/animations: 4.3.1
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/platform-server: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.1
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1

Did you try version 4.3.1?

@BioPhoton Yeah I updated all packages, still no luck. Dependencies I'm using:

"dependencies": {
    "@angular/animations": "^4.3.1",
    "@angular/cdk": "github:angular/cdk-builds",
    "@angular/common": "^4.3.1",
    "@angular/compiler": "^4.3.1",
    "@angular/core": "^4.3.1",
    "@angular/forms": "^4.3.1",
    "@angular/http": "^4.3.1",
    "@angular/material": "github:angular/material2-builds",
    "@angular/platform-browser": "^4.3.1",
    "@angular/platform-browser-dynamic": "^4.3.1",
    "@angular/platform-server": "^4.3.1",
    "@angular/router": "^4.3.1",
    "angular-resizable-element": "^1.2.0",
    "bootstrap": "^4.0.0-alpha.6",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "intl": "^1.2.5",
    "mdi": "^1.9.33",
    "moment": "^2.18.1",
    "rxjs": "^5.4.1",
    "tinymce": "^4.6.4",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.2.1",
    "@angular/compiler-cli": "^4.3.1",
    "@types/jasmine": "^2.5.47",
    "@types/node": "^8.0.14",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "phantomjs-prebuilt": "^2.1.14",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "^5.5.0",
    "typescript": "^2.4.2"
  }

@ginomessmer Might want to try downgrading typescript to 2.3.4 to solve your issue. @angular/cli is using 2.3.4 internally and doesn't seem to support 2.4 until v1.3.0-rc.0. That fixed the problem for me.

This is a problem with ts-node, if you upgrade to ts-node@latest you should be fine.

Thanks for the input @filipesilva, it seems to do the trick.

My error is that I forget to install
"@types/jasmine": "2.6.3", "@types/node": "^8.0.51", in devDependencies, it is work when I install them.

Update to 4.1.0 from 3.3.0 fixed it for me.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gotschmarcel picture gotschmarcel  Â·  3Comments

JanStureNielsen picture JanStureNielsen  Â·  3Comments

NCC1701M picture NCC1701M  Â·  3Comments

IngvarKofoed picture IngvarKofoed  Â·  3Comments

hartjo picture hartjo  Â·  3Comments