Error TS1005: ';' expected. TypeScript Angular 6 For First Build error rxjs inside node_modules

后端 未结 18 1907
北恋
北恋 2021-01-31 13:37

I\'m building my first Angular Application. I\'m creating a new Angular application using this command ng new purchase-section. But when I executing the application

18条回答
  •  时光说笑
    2021-01-31 13:54

    Your package.json has following lines:

    "rxjs": "^6.0.0",
    
    "typescript": "~2.7.2"
    

    This tells npm to install the following versions

    rxjs: Latest version in version 6 series which is 6.4.0

    typescript: Latest patched version in minor version 2.7 which is 2.7.2

    Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.

    So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as

    typescript: ^2.8.0

    or bump down the version of ngrx to something like

    ngrx: ~6.0.0 and

    do a fresh npm install.

    You can check the version number of the module installed by looking in following files:

    node_modules/rxjs/package.json and
    node_modules/typescript/package.json 
    

提交回复
热议问题