node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected error after installation of Angular 6

前端 未结 16 928
甜味超标
甜味超标 2020-12-22 17:15

I got an error of

node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: \';\' expected.

after the installation of Angular

相关标签:
16条回答
  • 2020-12-22 17:35

    Earlier, I used to fix the problem with @TheParam's answer but lately started using yarn. Sadly I could not find yarn equivalent of

    nmp update
    

    I tried using

    yarn upgrade
    

    (although it is not equivalent of above command afaik) and it did not help.

    I instead used

    yarn add rxjs@6.0.0
    

    and it worked. It took considerable time 82 sec as compared to few seconds in case of npm but fixed the issue. my node 8.11.2 and yarn 1.15.2

    0 讨论(0)
  • 2020-12-22 17:35

    I had the same issue, the "rxjs": "^6.0.0" to "rxjs": "6.0.0" didn't work. I had to update my angular CLI to last stable npm install -g @angular/cli and regenerate the project again.

    My config now is :

    Angular CLI: 7.3.6
    Node: 10.15.3
    OS: win32 x64
    Angular: 7.2.9
    
    0 讨论(0)
  • 2020-12-22 17:35

    Just do the one changes in package.json file

    "rxjs": "^6.0.0",
    

    Just delete the ^ like i did in the below code & update the npm(node package manager)

    "rxjs": "6.0.0",
    

    npm update

    ng serve --open

    Now file your project will start normally

    0 讨论(0)
  • 2020-12-22 17:41

    This issue is caused by version of typescript installed was not compatible with that of the rxjs installed.Installation of typescript as mentioned below helped me install the compatible version of typescript with that of the angular packages already installed.You can resolve the issue by the below command

    npm install typescript 
    

    This worked for me

    0 讨论(0)
  • 2020-12-22 17:43

    I just needed to edit the file and add the semicolon at the final line after 0 as shown here:

    Go to the path [project directory]/node_modules/rxjs/internal and open the file types.d.ts as administrator, move to the final of the file and add a semicolon.

    Original code: export declare type ObservedValueOf<O> = O extends ObservableInput<infer T> ? T : never;

    Modified code: export declare type ObservedValueOf<O> = O; extends ObservableInput<infer T> ? T : never;

    0 讨论(0)
  • 2020-12-22 17:43

    Go to package.json and update "rxjs": "^6.0.0" to "rxjs": "6.0.0" after that do npm update

    0 讨论(0)
提交回复
热议问题