dav*_*oli 6 npm typescript ngx-translate angular
我已经在我的应用程序中安装了@ngx-translate/core
版本 14.0.0 和@ngx-translate/http-loader
版本 ^7.0.0,并遵循了一些关于如何向 Angular 站点添加多种语言的教程(例如this )。我的 Angular 版本是 11.2.10。
当我成功完成所有步骤后,出现此错误。我尝试了多种方法,例如更新版本,但都没有解决问题。
\n有谁知道如何解决这个问题?
\nError: node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts:34:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n34 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<FakeMissingTranslationHandler, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/missing-translation-handler.d.ts:35:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n35 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<FakeMissingTranslationHandler>;\n ~~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.compiler.d.ts:12:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n12 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateFakeCompiler, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.compiler.d.ts:13:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n13 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<TranslateFakeCompiler>;\n ~~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.directive.d.ts:24:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n24 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateDirective, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.directive.d.ts:25:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5DirectiveDeclaration\'.\n25 static \xc9\xb5dir: i0.\xc9\xb5\xc9\xb5DirectiveDeclaration<TranslateDirective, "[translate],[ngx-translate]", never, { "translate": "translate"; "translateParams": "translateParams"; }, {}, never>;\n ~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.loader.d.ts:11:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.[[39m0m\n11 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateFakeLoader, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.loader.d.ts:12:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n12 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<TranslateFakeLoader>;\n ~~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.parser.d.ts:24:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n24 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateDefaultParser, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.parser.d.ts:25:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n25 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<TranslateDefaultParser>;\n ~~~~~~~~~~~~~~~~~~~~~~~\n[0[39mm\nError: node_modules/@ngx-translate/core/lib/translate.pipe.d.ts:22:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n22 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslatePipe, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.pipe.d.ts:23:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5PipeDeclaration\'.\n23 static \xc9\xb5pipe: i0.\xc9\xb5\xc9\xb5PipeDeclaration<TranslatePipe, "translate">;\n ~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.pipe.d.ts:24:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n24 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<TranslatePipe>;\n ~~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.service.d.ts:190:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n190 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateService, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/lib/translate.service.d.ts:191:22 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectableDeclaration\'.\n191 static \xc9\xb5prov: i0.\xc9\xb5\xc9\xb5InjectableDeclaration<TranslateService>;\n ~~~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/public_api.d.ts:32:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5FactoryDeclaration\'.\n32 static \xc9\xb5fac: i0.\xc9\xb5\xc9\xb5FactoryDeclaration<TranslateModule, never>;\n ~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/public_api.d.ts:33:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5NgModuleDeclaration\'.\n33 static \xc9\xb5mod: i0.\xc9\xb5\xc9\xb5NgModuleDeclaration<TranslateModule, [typeof i1.TranslatePipe, typeof i2.TranslateDirective], never, [typeof i1.TranslatePipe, typeof i2.TranslateDirective]>;\n ~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@ngx-translate/core/public_api.d.ts:34:21 - error TS2694: Namespace \'"/home/tk18d/Desktop/archivdatenbank/source/frontend-ng/node_modules/@angular/core/core"\' has no exported member \'\xc9\xb5\xc9\xb5InjectorDeclaration\'.\n34 static \xc9\xb5inj: i0.\xc9\xb5\xc9\xb5InjectorDeclaration<TranslateModule>;\n ~~~~~~~~~~~~~~~~~~~~~\nError: node_modules/@six/ui-library/dist/types/components/six-root/six-root.d.ts:22:19 - error TS2304: Cannot find name \'ResizeObserver\'.\n22 resizeObserver: ResizeObserver;\n ~~~~~~~~~~~~~~\nError: node_modules/@six/ui-library/dist/types/components/six-tab-group/six-tab-group.d.ts:30:19 - error TS2304: Cannot find name \'ResizeObserver\'.\n30 resizeObserver: ResizeObserver;\n ~~~~~~~~~~~~~~\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1139:11-31\nCan\'t import the named export \'ChangeDetectorRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1168:12-32\nCan\'t import the named export \'ChangeDetectorRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1318:11-31\nCan\'t import the named export \'ChangeDetectorRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1352:12-32\nCan\'t import the named export \'ChangeDetectorRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1157:10-19\nCan\'t import the named export \'Directive\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1137:11-24\nCan\'t import the named export \'ElementRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1166:12-25\nCan\'t import the named export \'ElementRef\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 327:35-47\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 335:28-40\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 343:35-47\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 376:36-48\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 377:29-41\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 378:36-48\nCan\'t import the named export \'EventEmitter\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 936:14-20\nCan\'t import the named export \'Inject\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 942:14-20\nCan\'t import the named export \'Inject\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 948:14-20\nCan\'t import the named export \'Inject\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 954:14-20\nCan\'t import the named export \'Inject\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 39:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 76:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 259:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 300:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 920:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1339:10-20\nCan\'t import the named export \'Injectable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 348:22-36\nCan\'t import the named export \'InjectionToken\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 349:29-43\nCan\'t import the named export \'InjectionToken\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 350:29-43\nCan\'t import the named export \'InjectionToken\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 351:23-37\nCan\'t import the named export \'InjectionToken\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1173:12-17\nCan\'t import the named export \'Input\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1176:12-17\nCan\'t import the named export \'Input\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1457:10-18\nCan\'t import the named export \'NgModule\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1341:10-14\nCan\'t import the named export \'Pipe\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 725:11-17\nCan\'t import the named export \'concat\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 747:11-17\nCan\'t import the named export \'concat\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 704:43-52\nCan\'t import the named export \'concatMap\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 725:18-23\nCan\'t import the named export \'defer\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 747:18-23\nCan\'t import the named export \'defer\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 656:15-23\nCan\'t import the named export \'forkJoin\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 649:12-24\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 655:37-49\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 706:15-27\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 710:13-25\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 749:13-25\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 765:8-20\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1088:12-24\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 1201:10-22\nCan\'t import the named export \'isObservable\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 572:56-59\nCan\'t import the named export \'map\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 656:38-41\nCan\'t import the named export \'map\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 14:11-13\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 527:13-15\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 545:13-15\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 655:75-77\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 706:41-43\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 710:39-41\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 731:15-17\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 749:39-41\nCan\'t import the named export \'of\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 571:77-88\nCan\'t import the named export \'shareReplay\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 572:114-125\nCan\'t import the named export \'shareReplay\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 725:95-104\nCan\'t import the named export \'switchMap\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 747:88-97\nCan\'t import the named export \'switchMap\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-core.mjs 503:19-23\nCan\'t import the named export \'take\' from non EcmaScript module (only default export is available)\nError: ./node_modules/@ngx-translate/core/fesm2015/ngx-translate-c
Ame*_*mer 10
您似乎使用了错误的@ngx-translate/core
&版本@ngx-translate/http-loader
,该版本仅适用于 Angular 13,并且不适用于以前的版本。
由于您使用的是 Angular 11,因此您必须安装以下版本:
在 ngx-translate 文档上阅读更多详细信息: https: //github.com/ngx-translate/core#installation