更新我的角度版本后运行时ng serve出现以下错误:
An unhandled exception occurred: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\@angular-devkit\build-angular\src\dev-server' is not supported
resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/@angular-devkit/build-angular/src/dev-server/index.js?
See "C:\Users\xxx\AppData\Local\Temp\ng-TMJqg5\angular-errors.log" for further details.
Run Code Online (Sandbox Code Playgroud)
日志输出:
[error] Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\@angular-devkit\build-angular\src\dev-server' is not supported resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/@angular-devkit/build-angular/src/dev-server/index.js?
at finalizeResolution (internal/modules/esm/resolve.js:272:17)
at moduleResolve (internal/modules/esm/resolve.js:699:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:229:28)
at Loader.import (internal/modules/esm/loader.js:164:28)
at importModuleDynamically (internal/modules/cjs/loader.js:1006:27)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at …Run Code Online (Sandbox Code Playgroud) 我需要对List<string>以下2条规则进行排序。
我的string作为元件将总是被格式化XXXnnnnE或者XXXnnnnD其中X是从A大写字母到Z和n是数字0到9。
我想按字母顺序对列表进行排序,但我希望E字符串先于D字符串,如下所示
DFG0001D
AWK0007E
ORK0127E
AWK0007D
DFG0001E
ORK0127D
Run Code Online (Sandbox Code Playgroud)
需要排序为
AWK0007E
AWK0007D
DFG0001E
DFG0001D
ORK0127E
ORK0127D
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
感谢帮助
我正在开发 Angular 9 项目。随着项目不断增长,我决定将代码拆分为功能模块。我创建了一个单独的功能模块,声明并导出了每个子组件。我还在 AppModule 中导入了功能模块。
运行后ng serve,我仍然遇到此错误:(If 'app-component-name' is an Angular component, then verify that it is part of this module.该错误发生在我的功能模块中使用的每个组件上,导致数十个错误行具有相同的消息。)
这是一个片段
登陆页面.module.ts
//Core imports
...
//Lib imports
...
//Routing
import { LandingPageRoutingModule } from './landing-page-routing.module';
//Shared components
...
//Components
import { LandingPageComponent } from './landing-page.component';
import { SectionCompositionLayoutComponent } from './section-composition/section-composition-layout/section-composition-layout.component';
import { SectionPresentationLayoutComponent } from './section-presentation/section-presentation-layout/section-presentation-layout.component';
import { SectionContactLayoutComponent } from './section-contact/section-contact-layout/section-contact-layout.component';
import { SectionDescriptionLayoutComponent } from './section-description/section-description-layout/section-description-layout.component';
import { SectionHeaderLayoutComponent } from …Run Code Online (Sandbox Code Playgroud)