Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法运行angular应用程序_Angular - Fatal编程技术网

无法运行angular应用程序

无法运行angular应用程序,angular,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://loc

我在本地和@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.

这将解决问题

有两种解决方案:

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

2-使用以下版本:

npm install rxjs@6.0.0 --save 

您正在使用引发错误的版本。请尝试此版本:npm安装rxjs@6.0.0--saveyou排除tsconfig.json中的node_模块吗?@ANKIT DHORELIYA我也有同样的错误。我运行了
npm安装rxjs@6.0.0--保存
,然后修复它。然而,显示的网页是一个不同的欢迎页面(显示旧的“英雄之旅”),而不是显示的非常不同的页面。你看到了哪一页?我的package.json文件中没有
typescript
依赖项。我需要添加它吗?如果是,在哪里?我的配置太长,无法在此评论框中发布,但My.json具有以下对象:
脚本
依赖项
依赖项
。我是否将
typescript:~2.8
添加到其中一个中?谢谢。@Chris22是的,在package.json中添加类型脚本。typescript的版本取决于您的脚本的版本。第九个例子:谢谢。从您的链接中,我似乎应该将
typescript:~2.8
添加到我的
依赖项
对象中。但是,我在
devdependency
对象中没有看到它。既然我在我的dev box上运行Angular,它不也应该在那里吗?@Chris22您只需要在
devdependences
对象中使用它。即使您正在使用dev box,它也应该在那里。谢谢。是的,typescript不在我提到的
devdependences
对象中——在我的package.json中,
typescript:~2.8
没有列出。我不知道为什么不是。
npm install rxjs@6.0.0 --save