简体   繁体   English

从 Angular 7 更新到 Angular 8 后的构建问题

[英]Build issue after updating from Angular 7 to Angular 8

I recently updated a project from Angular 7 to Angular 8. When I go to build to prod I'm now getting the following error.我最近将一个项目从 Angular 7 更新到了 Angular 8。当我开始构建到 prod 时,我现在收到以下错误。

ERROR in app/app.component.ts:7:36 - error TS2307: Cannot find module '@angular/router/src/router_module'. app/app.component.ts 中的错误:7:36 - 错误 TS2307:找不到模块“@angular/router/src/router_module”。 7 import { routerNgProbeToken } from "@angular/router/src/router_module"; 7 从“@angular/router/src/router_module”导入 { routerNgProbeToken };

I've gone into the app.component.ts file to take a look at what the problem is, and it says (similar to the build error) cannot find @angular/router/src/router_module .我已经进入 app.component.ts 文件查看问题是什么,它说(类似于构建错误)找不到@angular/router/src/router_module I haven't touched this project for over a year and I'm struggling to resolve this one (also I'm not that experienced with Angular so that doesn't help either)我已经一年多没有接触过这个项目了,我正在努力解决这个问题(我对 Angular 也没有那么熟悉,所以这也无济于事)

Any suggestions on how I might resolve this so that I can build again would be greatly apprecited.任何关于我如何解决这个问题以便我可以再次构建的建议将不胜感激。

Try this as your import :试试这个作为你的import

import { RouterModule } from '@angular/router';从 '@angular/router' 导入 { RouterModule };

Remove /src/router_module on the end of the path.删除路径末尾的/src/router_module

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更新到Angular 6后,Angular材料库出现问题 - Issue with Angular material library after updating to Angular 6 @angular/cdk 和 @angular/form 更新到 Angular 11 后生成错误 - @angular/cdk and @angular/form build errors after updating to Angular 11 更新到 Angular 9 和 Typescript 3.8.3 后生成错误 - Build errors after updating to Angular 9 and Typescript 3.8.3 角度2 | 更新视图后,RXjs问题与distinctUntilChanged有关 - Angular 2 | RXjs issue with distinctUntilChanged after updating view Angular 8 从 Angular 7 迁移后构建失败 - Angular 8 fails to build after migration from Angular 7 将angular2更新为angular4后出现编译问题 - Compilation issue after updating the angular2 to angular4 从角度2升级到4后出现的问题 - Issue after upgrading from angular 2 to 4 从Angle 4更新到6版本时出现的问题 - Issue while updating from angular 4 to 6 version 从 Angular 9 更新到 Angular 10 后出现构建错误:“无法绑定到 'selectedValue' 中的错误,因为它不是 'tbody' 的已知属性” - Build error after updating from Angular 9 to Angular 10: “ERROR in Can't bind to 'selectedValue' since it isn't a known property of 'tbody'” 将 Angular cli 从 8 更新到 10 后出错 - error after updating Angular cli from 8 to 10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM