我试图添加ngx-扩展-pdf-查看器到我现有的应用程序,没有运气。我的应用程序目前运行在角11上,我安装了Nodev16.15和NPM8.5.5。当ngx扩展-pdf-查看器时,我会收到一些关于节点和npm之间不匹配的警告,但是它安装得很好。然后,当我进入到我的app.module.ts文件和下面的行
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';一旦我运行了服务,就像圣诞节一样,无法编译,下面是一些非常相似的错误。我甚至移除ol node_modules并从零开始安装,没有任何运气。我甚至尝试在我的Mac系统上安装,我也得到了同样的错误。是否有任何设置,我错过了使这个工作,因为我有一个普通的角度13工程,它的工作刚刚好。
Error: node_modules/ngx-extended-pdf-viewer/lib/dynamic-css/dynamic-css.component.d.ts:20:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
20 static ɵfac: i0.ɵɵFactoryDeclaration<DynamicCssComponent, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/ngx-extended-pdf-viewer/lib/dynamic-css/dynamic-css.component.d.ts:21:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵComponentDeclaration'.
21 static ɵcmp: i0.ɵɵComponentDeclaration<DynamicCssComponent, "pdf-dynamic-css", never, { "zoom": "zoom"; "width": "width"; }, {}, never, never>;
~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/ngx-extended-pdf-viewer/lib/ngx-extended-pdf-viewer-common.module.d.ts:62:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
62 static ɵfac: i0.ɵɵFactoryDeclaration<NgxExtendedPdfViewerCommonModule, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/ngx-extended-pdf-viewer/lib/ngx-extended-pdf-viewer-common.module.d.ts:63:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.
63 static ɵmod: i0.ɵɵNgModuleDeclaration<NgxExtendedPdfViewerCommonModule, [typeof i1.DynamicCssComponent, typeof i2.PdfZoomDropdownComponent, typeof i3.PdfContextMenuComponent, typeof i4.PdfPresentationModeComponent, typeof i5.PdfOpenFileComponent, typeof i6.PdfPrintComponent, typeof i7.PdfDownloadComponent, typeof i8.PdfBookmarkComponent, typeof i9.PdfZoomToolbarComponent, typeof i10.PdfPagingAreaComponent, typeof i11.PdfFindbarComponent, typeof i12.PdfSidebarComponent, typeof i13.PdfHandToolComponent, typeof i14.PdfSelectToolComponent, typeof i15.PdfSecondaryToolbarComponent, typeof i16.PdfSearchInputFieldComponent, typeof i17.PdfFindPreviousComponent, typeof i18.PdfFindNextComponent, typeof i19.PdfFindInputAreaComponent, typeof i20.PdfFindbarOptionsTwoContainerComponent, typeof i21.PdfFindbarOptionsOneContainerComponent, typeof i22.PdfFindMatchCaseComponent, typeof i23.PdfFindHighlightAllComponent, typeof i24.PdfFindEntireWordComponent, typeof i25.PdfFindFuzzilyComponent, typeof i26.PdfFindMultipleSearchTextsComponent, typeof i27.PdfFindIgnoreAccentsComponent, typeof i28.PdfFindbarOptionsThreeContainerComponent, typeof i29.PdfFindResultsCountComponent, typeof i30.PdfFindbarMessageContainerComponent, typeof i31.PdfFindRangeComponent, typeof i32.PdfFindCurrentPageOnlyComponent, typeof i33.PdfToolbarComponent, typeof i34.PdfFindButtonComponent, typeof i35.PdfToggleSidebarComponent, typeof i36.PdfToggleSecondaryToolbarComponent, typeof i37.PdfLastPageComponent, typeof i38.PdfFirstPageComponent, typeof i39.PdfNextPageComponent, typeof i40.PdfPreviousPageComponent, typeof i41.PdfPageNumberComponent, typeof i42.PdfRotatePageComponent, typeof i43.PdfZoomInComponent, typeof i44.PdfZoomOutComponent, typeof i45.PdfDummyComponentsComponent, typeof i46.PdfSidebarContentComponent, typeof i47.PdfSidebarToolbarComponent, typeof i48.PdfOriginalComponent, typeof i49.PdfDarkThemeComponent, typeof i50.PdfLightThemeComponent, typeof i51.TranslatePipe, typeof i52.PdfAcroformDefaultThemeComponent, typeof i53.PdfAcroformDarkThemeComponent, typeof i54.PdfDocumentPropertiesDialogComponent, typeof i55.PdfPasswordDialogComponent, typeof i56.PdfPreparePrintingDialogComponent, typeof i57.PdfErrorMessageComponent], [typeof i58.CommonModule, typeof i59.FormsModule], [typeof i2.PdfZoomDropdownComponent, typeof i3.PdfContextMenuComponent, typeof i4.PdfPresentationModeComponent, typeof i5.PdfOpenFileComponent, typeof i6.PdfPrintComponent, typeof i7.PdfDownloadComponent, typeof i8.PdfBookmarkComponent, typeof i9.PdfZoomToolbarComponent, typeof i10.PdfPagingAreaComponent, typeof i11.PdfFindbarComponent, typeof i12.PdfSidebarComponent, typeof i46.PdfSidebarContentComponent, typeof i47.PdfSidebarToolbarComponent, typeof i15.PdfSecondaryToolbarComponent, typeof i16.PdfSearchInputFieldComponent, typeof i17.PdfFindPreviousComponent, typeof i18.PdfFindNextComponent, typeof i19.PdfFindInputAreaComponent, typeof i20.PdfFindbarOptionsTwoContainerComponent, typeof i21.PdfFindbarOptionsOneContainerComponent, typeof i22.PdfFindMatchCaseComponent, typeof i23.PdfFindHighlightAllComponent, typeof i24.PdfFindEntireWordComponent, typeof i26.PdfFindMultipleSearchTextsComponent, typeof i27.PdfFindIgnoreAccentsComponent, typeof i28.PdfFindbarOptionsThreeContainerComponent, typeof i29.PdfFindResultsCountComponent, typeof i30.PdfFindbarMessageContainerComponent, typeof i31.PdfFindRangeComponent, typeof i32.PdfFindCurrentPageOnlyComponent, typeof i13.PdfHandToolComponent, typeof i42.PdfRotatePageComponent, typeof i14.PdfSelectToolComponent, typeof i33.PdfToolbarComponent, typeof i34.PdfFindButtonComponent, typeof i35.PdfToggleSidebarComponent, typeof i36.PdfToggleSecondaryToolbarComponent, typeof i37.PdfLastPageComponent, typeof i38.PdfFirstPageComponent, typeof i39.PdfNextPageComponent, typeof i40.PdfPreviousPageComponent, typeof i41.PdfPageNumberComponent, typeof i43.PdfZoomInComponent, typeof i44.PdfZoomOutComponent, typeof i48.PdfOriginalComponent, typeof i49.PdfDarkThemeComponent, typeof i50.PdfLightThemeComponent, typeof i51.TranslatePipe, typeof i1.DynamicCssComponent, typeof i45.PdfDummyComponentsComponent, typeof i52.PdfAcroformDefaultThemeComponent, typeof i53.PdfAcroformDarkThemeComponent, typeof i54.PdfDocumentPropertiesDialogComponent, typeof i55.PdfPasswordDialogComponent, typeof i56.PdfPreparePrintingDialogComponent, typeof i57.PdfErrorMessageComponent]>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/ngx-extended-pdf-viewer/lib/ngx-extended-pdf-viewer-common.module.d.ts:64:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.
64 static ɵinj: i0.ɵɵInjectorDeclaration<NgxExtendedPdfViewerCommonModule>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/ngx-extended-pdf-viewer/lib/ngx-extended-pdf-viewer-server.component.d.ts:196:21 - error TS2694: Namespace '"C:/Users/admin/Documents/GitHub/Angular-7-CRM/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
196 static ɵfac: i0.ɵɵFactoryDeclaration<NgxExtendedPdfViewerServerComponent, never>;
~~~~~~~~~~~~~~~~~~~~ 发布于 2022-05-05 17:17:17
这个库和Range11似乎有一个问题。现在的解决办法是将库的代码降到10.5,这对我来说是有效的。
发布于 2022-11-22 11:31:06
将nodeJS还原为版本14
然后
npm i ngx-extended-pdf-viewer然后在app.module
import {NgxExtendedPdfViewerModule} from "ngx-extended-pdf-viewer";https://stackoverflow.com/questions/72120914
复制相似问题