gpt4 book ai didi

angular - 命名空间 node_module/@angular/core/core 没有导出成员 ɵɵFactoryDe​​claration | ɵɵInjectorDeclaration | ɵɵNgModuleDeclaration

转载 作者:行者123 更新时间:2023-12-04 04:32:01 28 4
gpt4 key购买 nike

问题
我正在尝试从 Angular V9 升级到 V11,但由于以下错误而苦苦挣扎Namespace node_module/@angular/core/core has no exported member ɵɵFactoryDeclarationNamespace node_module/@angular/core/core has no exported member ɵɵInjectorDeclarationNamespace node_module/@angular/core/core has no exported member ɵɵNgModuleDeclarationNamespace node_module/@angular/core/core has no exported member ɵɵɵComponentDeclaration但我不完全确定这意味着什么以及如何解决它。
我试过的
我看过一个类似的问题:Ng serve throwing @angular/core/core has no exported member 'eeFactoryDef' 这是我能找到的唯一线索,但它并没有真正帮助我。
我尝试删除我的整个 node_modules 文件夹并使用 npm i 重新安装 npm 依赖项。我也试过 npm ci。我也尝试添加

      "@angular/core/*": [
"./node_modules/@angular/core/*"
]
要么
      "@angular/*": [
"./node_modules/@angular/*"
]
到我的 tsconfig.json ,但这也没有帮助。
我认为是问题
我对此一无所知,但我认为我的 NPM 依赖项的路径有问题,因为它指的是 @angular/core/core ,但我的 node_modules 中没有这样的文件夹。
如果我转到 node_modules/@angular/core/core.d.ts 文件,我认为该文件是 /core/core 路径,尽管我不确定这一点,但我也会在那里看到相同的错误,这让我更加困惑,因为我认为问题出在 Angular 之间和依赖项,但不在 Angular 本身内。
Package.json
{
"name": "WorthaShot",
"version": "0.0.3",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build:prod": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.0.0-next.7",
"@angular/cdk": "^11.2.7",
"@angular/common": "~12.0.0-next.7",
"@angular/compiler": "~12.0.0-next.7",
"@angular/core": "~11.2.8",
"@angular/fire": "^6.1.4",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/forms": "~12.0.0-next.7",
"@angular/material": "^11.2.7",
"@angular/platform-browser": "~12.0.0-next.7",
"@angular/platform-browser-dynamic": "~12.0.0-next.7",
"@angular/router": "~12.0.0-next.7",
"@angular/service-worker": "~12.0.0-next.7",
"@fortawesome/angular-fontawesome": "^0.8.2",
"@fortawesome/fontawesome-common-types": "^0.2.35",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@ngbmodule/material-carousel": "^0.7.1",
"@ngx-meta/core": "^9.0.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"firebase": "^8.3.2",
"flag-icon-css": "^3.5.0",
"guid-typescript": "^1.0.9",
"ngx-color-picker": "^10.1.0",
"ngx-image-compress": "^8.0.4",
"ngx-markdown": "^10.1.1",
"ngx-sharebuttons": "^8.0.5",
"ngx-spinner": "^10.0.1",
"ngx-toastr": "^13.2.1",
"rxjs": "~6.6.7",
"tslib": "^2.2.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1102.7",
"@angular/cli": "~11.2.7",
"@angular/compiler-cli": "~12.0.0-next.7",
"@angular/language-service": "~12.0.0-next.7",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^14.14.37",
"codelyzer": "^6.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.10.2",
"tslint": "~6.1.3",
"typescript": "^4.2.3"
}
}

我在这里缺少什么或不理解什么?

最佳答案

如果您在安装了primeng 后遇到了这个问题,请注意最新版本的primeng (12.0.0-rc.1) 不适用于最新版本的angular。您需要安装更早版本的primeng,对我来说11.4 完美运行!

npm i primeng@11.4.2

关于angular - 命名空间 node_module/@angular/core/core 没有导出成员 ɵɵFactoryDe​​claration | ɵɵInjectorDeclaration | ɵɵNgModuleDeclaration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66987715/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com