问题
我正在尝试从 Angular V9 升级到 V11,但由于以下错误而苦苦挣扎
Namespace node_module/@angular/core/core has no exported member ??FactoryDeclaration
Namespace node_module/@angular/core/core has no exported member ??InjectorDeclaration
Namespace node_module/@angular/core/core has no exported member ??NgModuleDeclaration
Namespace node_module/@angular/core/core has no exported member ???ComponentDeclaration
但我不完全确定这意味着什么以及如何解决它。
我试过的
我看过一个类似的问题:Ng serve throwing @angular/core/core 没有导出成员 'eeFactoryDef'这是我能找到的唯一线索,但它并没有真正帮助我。
我尝试删除我的整个 node_modules 文件夹并使用npm i. 我也试过npm ci了。我也尝试添加
"@angular/core/*": [
"./node_modules/@angular/core/*"
]
Run Code Online (Sandbox Code Playgroud)
或者
"@angular/*": [
"./node_modules/@angular/*"
]
Run Code Online (Sandbox Code Playgroud)
到我的tsconfig.json,但这也没有帮助。
我认为是什么问题
我对此一无所知,但我认为我的 NPM 依赖项的路径有问题,因为它引用了@angular/core/core,但我的node_modules.
如果我转到node_modules/@angular/core/core.d.ts我认为是/core/core路径的文件,尽管我不确定这一点,然后我也会在那里看到相同的错误,这让我更加困惑,因为我认为问题出在 Angular …
我正在开发一个应用程序,我第一次使用 PWA,并且尝试使用推送通知等。
目前,如果我执行以下命令ng build --prod和http-server -p 8080 -c-1 dist/myProject,我就可以让 PWA 工作,但我想知道是否有一种方法可以让 PWA 工作ng serve,这样我就不必经常构建项目,因为这需要相当长的时间。
编辑:添加信息
我尝试通过添加serve来修改对象angular.json
"assets": [
"src/manifest.webmanifest"
]
Run Code Online (Sandbox Code Playgroud)
属性,options但这给出了错误Data path "" should NOT have additional properties(assets),所以我认为这不是要走的路。
production-environment progressive-web-apps angular angular9