Skip to content

Serve errors with TypeScript 2.0.2 #1917

Closed

Description

@ValeryVS

OS

Ubuntu 14.04

Versions

angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: linux x64

Repro steps.

Create fresh project with webpack.8 or update existed.
There will be "typescript": "^2.0.0" dependency in package.json.

The log given by the failure.

ERROR in [default] 
Cannot find global type 'Array'.

ERROR in [default] 
Cannot find global type 'Boolean'.

ERROR in [default] 
Cannot find global type 'Function'.

ERROR in [default] 
Cannot find global type 'IArguments'.

ERROR in [default] 
Cannot find global type 'Number'.

ERROR in [default] 
Cannot find global type 'Object'.

ERROR in [default] 
Cannot find global type 'RegExp'.

ERROR in [default] 
Cannot find global type 'String'.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/@angular/common/src/directives/ng_class.d.ts:81:33 
Cannot find name 'Set'.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/@angular/common/src/directives/ng_if.d.ts:37:76 
Cannot find name 'Object'.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/@angular/common/src/directives/ng_plural.d.ts:78:53 
Cannot find name 'Object'.

...

Multiple "Cannot find name" errors in @angular and rjxs files here.

...

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:17:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.core.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:18:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.collection.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:19:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.generator.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:20:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.iterable.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:21:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.promise.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:22:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.proxy.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:23:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.reflect.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:24:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.symbol.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:25:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts' not found.

ERROR in [default] /home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es2015.d.ts:26:0 
File '/home/valeryvs/Git/angular-cli-test-3/node_modules/typescript/lib/lib.es5.d.ts' not found.

Workaround

Lock TypeScript version at 2.0.0 in package.json.

-"typescript": "^2.0.0"
+"typescript": "2.0.0"

Activity

  1. eyedol commented on Aug 31, 2016

    @eyedol
  2. ValeryVS commented on Aug 31, 2016

    @ValeryVS
    ContributorAuthor

    Right, duplicate. Missed that issue.

  3. rakibler commented on Aug 31, 2016

    @rakibler

    Sorry, mine sort of had a bad title

  4. clifntx commented on Sep 1, 2016

    @clifntx

    Check out dematic-rodrigo-silveira's post on #1919. I will summarize below. Huge thanks to dematic-rodrigo-silveira! I was tearing my hair out about this one.

    For a new project, there are a few steps:

    Update Node to 6.5 and npm to 3.10.3

    • You can check your versions with node -v and npm -v respectively.
    • These can be both be updated from the nodejs.org download site. The installer installs both of them. https://nodejs.org/en/download/current/

    Update Typescript to 2.0+

    • check with tsc -v
    • npm install typescript@next will update you to 2.1.0

    Follow the README's instructions on installing the new cli

    • npm uninstall -g angular-cli
    • npm install -g angular-cli@webpack
    • npm new projectname Creates your new project
    • cd projectname moves you into the newly created directory

    Modify project dependencies

    • Open package.json from your apps root directory
    • Under "devDependancies", locate "typescript".
    • Change "^2.0.0" to "2.0.0". This locks yourproject at typescript 2.0.0 instead of 2.1.0.
    • Save

    ng serve
    app works!
    ng init
    npm install --save-dev angular-cli@webpack to set the correct cli

    Once this is complete, you should be able to serve and test without issues. I am loving the new cli.

    Thank you to the CLI team!
    Happy coding!

  5. billdwhite commented on Sep 1, 2016

    @billdwhite

    The problem with the solution from @SeekingMonkey is that now, RC6 has been released and it appears to have a dependency on 2.0.2 specifically . What now?

  6. aszechlicki commented on Sep 1, 2016

    @aszechlicki

    we probably need to wait with updating until angular-cli team fixes that
    fortunately RC6 isn't as revolutionary as RC5, it's mostly cleanup so waiting a couple days (hopefully) won't change much

  7. iBasit commented on Sep 1, 2016

    @iBasit

    +1

  8. emyann commented on Sep 2, 2016

    @emyann

    Very weird issue. Whenever I scaffold a new project with angular-cli: 1.0.0-beta.11-webpack.8 and try to build the project for the first time, I get a list of errors.
    My workaround was simply to uninstall / install typescript@beta and the project builds fine:
    npm uninstall --save-dev typescript
    npm install --save-dev typescript@beta
    ng build
    Asciinema record

  9. CalvinDale commented on Sep 2, 2016

    @CalvinDale

    I followed the process outlined by @SeekingMonkey. ng serve still threw the same list of exceptions. Then I tried @emyann's process and it started working.

  10. Blak3Nick commented on Sep 2, 2016

    @Blak3Nick

    I concur with @CalvinDale, I, also, could not get the process @SeekingMonkey described to work, but @emyann's worked like a charm.

  11. mcferren commented on Sep 4, 2016

    @mcferren

    me too - Thanks @emyann

  12. osimosu commented on Sep 4, 2016

    @osimosu

    The new cli actually requires typescript@2.0.0 which is currently in beta. Removing the old version and installing typescript@beta did the trick!

  13. filipesilva commented on Sep 20, 2016

    @filipesilva
    Contributor

    Closed as obsolete. The latest versions support typescript@2.0.2.

  14. yves-s commented on Oct 9, 2016

    @yves-s

    I still get the error as mentioned above:
    ERROR in [default]
    Property 'Error' does not exist on type 'typeof error'.
    ERROR in [default]
    Module 'webdriver.error' has no exported member 'IErrorCode'.
    ...
    ERROR in [default]
    Module 'webdriver' has no exported member 'Locator'.

    I already tried it with several ts ng combinations like:
    tsc: 2.0.0
    tsc: 2.0.2

    angular-cli: 1.0.0-beta.17
    angular-cli: 1.0.0-beta.16
    angular-cli: 1.0.0-beta.15

    node: 6.5.0

  15. filipesilva commented on Oct 10, 2016

    @filipesilva
    Contributor

    @yves-s yours seems like a different issue, related to protractor. Can you open a new issue with repro steps?

  16. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  17. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions