无法运行角度应用程序

时间:2019-05-29 12:15:08

标签: angular

我在本地和@angular cli v6.1.1中安装了node和npm。并使用ANGULAR6创建了应用程序名称。然后尝试运行该应用程序,但出现错误。

PS C:\Users\762739\Desktop\Local _test_Files\Angular\ANGULAR6> ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
       10% building modules 6/6 modules 0 activei 「wds」: Project is running at http://localhost:4200/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\762739\Desktop\Local _test_Files\Angular\ANGULAR6
i 「wds」: 404s will fallback to //index.html
Date: 2019-05-29T12:03:00.535Z
Hash: 39bd7e13701cafb5c814
Time: 2887ms
chunk {main} main.js, main.js.map (main) 344 kB [entry] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 344 kB [entry] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 359 kB [entry] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 10.2 kB [initial] [rendered]

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.
node_modules/rxjs/internal/types.d.ts(82,52): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(82,88): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(82,92): error TS1109: Expression expected.

2 个答案:

答案 0 :(得分:0)

npm install rxjs@6.0.0 --save

这将解决问题

答案 1 :(得分:0)

有两种解决方案:

1-更新您的TS版本:TS ^ 2.8 您可以通过将package.json中的Typescript版本从xx版本更改为"typescript": "~2.8"

来更新Typescript。

2-使用以下版本:

npm install rxjs@6.0.0 --save