首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将Ngx-admin升级到Angular 9

将Ngx-admin升级到Angular 9
EN

Stack Overflow用户
提问于 2020-03-28 01:32:48
回答 1查看 1.3K关注 0票数 1

我正在尝试将基于ngx admin的项目从angular 8升级到9。我遵循angular.io指南,也遵循指南建议的步骤:

代码语言:javascript
运行
复制
"If you are a library author and you had a method returning ModuleWithProviders (typically via a method named forRoot()), you will need to specify the generic type. Learn more angular.io"

然后,我将所有nebular组件升级到版本5.0.0。然后我升级ng2-smart-table到1.6版本,删除ng2-completer并安装@akveo/ng2-completer。(参见https://github.com/akveo/ng2-smart-table/pull/1140)

现在,通过运行ng serve,我得到了以下错误:

代码语言:javascript
运行
复制
ERROR in src/app/pages/pages.module.ts:22:12 - error NG1010: Value at position 4 in the NgModule.imports of PagesModule is not a reference: [object Object] 

 22   imports: [
               ~
 23     PagesRoutingModule,
    ~~~~~~~~~~~~~~~~~~~~~~~
...
 27     AuthModule.forRoot(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~
 28   ],
    ~~~
src/app/app.module.ts:39:12 - error NG1010: Value at position 4 in the NgModule.imports of AppModule is not a reference: [object Object]

 39   imports: [
               ~
 40     BrowserModule,
    ~~~~~~~~~~~~~~~~~~
...
 57     CoreModule.forRoot(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~
 58   ],
    ~~~
src/app/app.component.ts:13:14 - error NG8001: 'router-outlet' is not a known element:
1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

13   template: '<router-outlet></router-outlet>',
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:18:5 - error NG8001: 'ngx-one-column-layout' is not a known element:
1. If 'ngx-one-column-layout' is an Angular component, then verify that it is part of this module.
2. If 'ngx-one-column-layout' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.   

18     <ngx-one-column-layout>
       ~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.tsm:19:7 - error NG8001: 'nb-menu' is not a known element:
1. If 'nb-menu' is an Angular component, then verify that it is part of this module.
2. If 'nb-menu' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

19       <nb-menu [items]="menu"></nb-menu>
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:19:16 - error NG8002: Can't bind to 'items' since it isn't a known property of 'nb-menu'.
1. If 'nb-menu' is an Angular component and it has 'items' input, then verify that it is part of this module.
2. If 'nb-menu' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

19       <nb-menu [items]="menu"></nb-menu>
                  ~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:20:7 - error NG8001: 'router-outlet' is not a known element:
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

20       <router-outlet></router-outlet>
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

问题出在哪里?

非常感谢你提前

安德里亚

EN

回答 1

Stack Overflow用户

发布于 2020-03-28 01:43:42

NGX-Admin框架目前与angular 9不兼容。

在官方存储库的package.json中,您可以看到只引用了angular 8:https://github.com/akveo/ngx-admin/blob/master/package.json#L35

然而,已经有一个升级到angular 9和Neular5的拉取请求正在进行中:https://github.com/akveo/ngx-admin/pull/5628

您可以等待pull请求被合并,也可以尝试自己移植整个框架。

有关如何从angular 8升级到9的信息,请参考以下url:https://update.angular.io/

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60891218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档