node_modules/rxjs/internal/types.d.ts(81,44): erro

2019-03-09 06:59发布

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

Check the error:

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

4条回答
做自己的国王
2楼-- · 2019-03-09 07:17

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;

查看更多
Emotional °昔
3楼-- · 2019-03-09 07:20

I had the same error using angular 6 having rxjs@6.4.0 but i downgraded it to rxjs@6.3.3 it worked.

查看更多
来,给爷笑一个
4楼-- · 2019-03-09 07:26

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

查看更多
混吃等死
5楼-- · 2019-03-09 07:35

This problem might arise due to version mismatch. To solve your problem you need to do following changes in your package.json file.

Step 1 : Go to package.json and modify "rxjs": "^6.0.0" to "rxjs": "6.0.0"

Step 2 Run npm update in your project.

There is no need to change the typescript version. (Mine: "typescript": "~2.7.2")

Edit: If you are using rxjs-compat then you also need to do following in order to fixed the issue. change the rxjs-compat version from "rxjs-compat": "^6.2.2" to "rxjs-compat": "6.2.2"

Hope this will help!

查看更多
登录 后发表回答