我目前正在更新项目的角度版本。它是v10,我更新到v11。修正了许多错误,但ng2图表在ng发球时不断出现这些错误。
错误:node_modules/ng2 charts/lib/base chart.direction.d.ts:39:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出的成员"保理声明"。39 staticɵfac:i0;~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/base chart.direction.d.ts:40:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出的成员"导演声明"。40 staticɵdir:i0ons":"选项";"插件":"插件";"标签":"标签";"数据集":"数据集";},{"chartClick":"chartClick";"chartHover":"chartHover";};~~~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/ng charts.module.d.ts:14:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"actoryDeclaration"。14静态因素:i0.因素声明;~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/ng charts.module.d.ts:15:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"gModuleDeclaration。15静态ɵ模块:i0;~~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/ng charts.module.d.ts:16:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"njectorDeclaration。16静态ɵinj:i0;~~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/ng charts.module.d.ts:8:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"ctoryDeclaration。8静态因素:i0.因素声明;~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/ng charts.module.d.ts:9:22-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"jectableDeclaration。9静态证明:i0;~~~~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2 charts/lib/theme.service.dts:10:21-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"oryDeclaration。10静态因素:i0;~~~~~~~~~~~~~~~~~~~~错误:node_modules/ng2charts/lib/theme.service.d.ts:11:22-错误TS2694:命名空间"E:/projects/Credo/kratos/node_modules/@angular/core/core"没有导出成员"ɵInjectableDeclaration。11静态ɵ证明:i0;~~~~~~~~~~~~~~~~~~~~~~~错误:src/app/moduless/discussions/modules/view discussions.module.ts:18:10-错误TS2724:"ng2 charts"没有名为"ChartsModule"的导出成员。你是我吗一个"NgChartsModule"?18从"ng2 charts"导入{ChartsModule};~~~~~~~~~~~~node_modules/ng2 charts/lib/ng charts.module.d.ts:11:2211导出声明类NgChartsModule{~~~~~~~~~~~~~~此处声明了"NgChartsModule"。错误:src/app/modules/statistics/statistics.module.ts:4:10-错误TS2724:"ng2 charts"没有名为"ChartsModule"的导出成员。你是说"NgChartsModule"吗?4从"ng2 charts"导入{ChartsModule};~~~~~~~~~~~~node_modules/ng2 charts/lib/ng charts.module.d.ts:11:2211导出声明类NgChartsModule{~~~~~~~~~~~~~~此处声明了"NgChartsModule"。错误:/src/app/moduless/discussions/modules/view-description.modules.ts 48:16-28"在'ng2 charts'中找不到导出'ChartsModule'错误:/src/app/modules/statistics/sttatistics.modules.ts 32:16-28"在'ng2 charts'中找不到导出'ChartsModule'错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 13:35-50无法从非EcmaScript模块导入命名导出"BehaviorSubject"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 118:6-11无法从非EcmaScript模块导入命名导出"Chart"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 118:27-32无法从非EcmaScript模块导入命名导出"Chart"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 120:34-39无法从非EcmaScript模块导入命名导出"Chart"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 429:0-5无法从非EcmaScript模块导入命名导出"Chart"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 433:93-98无法从非EcmaScript模块导入命名导出"Chart"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 228:11-24无法从非EcmaScript模块导入命名导出"ElementRef"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 270:12-25无法从非EcmaScript模块导入命名导出"ElementRef"(只有默认导出可用)0m错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 67:26-38无法从非EcmaScript模块导入命名导出"EventEmitter"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 68:26-38无法从非EcmaScript模块导入命名导出"EventEmitter"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs50:10-20无法从非EcmaScript模块导入命名导出"Injectable"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 423:10-20无法从非EcmaScript模块导入命名导出"Injectable"(只有默认导出可用)错误:/node_modules/ngx窗口令牌/fesm2015/ngx-window-token.mjs 2:17-31无法从非EcmaScript模块导入命名导出"InjectionToken"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 279:12-17无法从非EcmaScript模块导入命名导出"Input"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 71:62-82无法从非EcmaScript模块导入命名导出"distinctUntilChanged"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 429:47-60无法从非EcmaScript模块导入命名导出"registerables"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 35:10-28无法从非EcmaScript模块导入命名导出"ɵFactoryTarget"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 234:10-28无法从非EcmaScript模块导入命名导出"ɵFactoryTarget"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 408:10-28无法从非EcmaScript模块导入命名导出"ɵFactoryTarget"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 460:10-28无法从非EcmaScript模块导入命名导出"ɵFactoryTarget"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 255:0-27无法从非EcmaScript模块导入命名导出"ɵngDeclareClassMetadata"(只有默认导出可用)错误:/节点模块/ng2图表/fesm2015/ng2-图表.mjs 29:20-41无法从非EcmaScript模块导入命名导出"ɵngDeclareFactory"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 222:26-47无法从非EcmaScript模块导入命名导出"ɵngDeclareFactory"(只有默认导出可用)错误:/node_modules/ng2 charts/fesm2015/ng2-charts.mjs 402:29-50无法从非EcmaScript模块导入命名导出"ɵngDeclareFactory"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 451:22-43无法从非EcmaScript模块导入命名导出"ɵngDeclareFactory"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 37:21-45无法从非EcmaScript模块导入命名导出"ɵngDeclareInjectable"(只有默认导出可用)在此处输入代码错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 410:30-54无法从非EcmaScript模块导入命名导出"ɵngDeclareInjectable"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 470:22-44无法从非EcmaScript模块导入命名导出"ɵngDeclareInjector"(只有默认导出可用)错误:/node_modules/ng2-chatts/fesm2015/ng2-charts.mjs 462:22-44无法从非EcmaScript模块导入命名导出"ɵngDeclareNgModule"(只有默认导出可用)
我尝试了许多不同版本的ng2 charts、chart.js和@types/chart.js,但似乎没有什么能解决它。
软件包.json
{"name":"kratos","版本":"15.17.1","发动机":{"npm":"请使用纱线","纱线":">=1.2.24","node":">=12.17"},"许可":"专有","存储库":{"type":"git","url":"https://github.com/credoweb/kratos.git"},"脚本":{"ng":"ng","start":"yarn patch:pdpfjs&&ng serve--禁用主机检查--主机0.0.0.0","start:ci":"纱线启动--progress=false","build":"yarn patch:pdpfjs&&node--最大旧空间大小=8192 node_modules/@angular/cli/bin/ng build--prod","build:client":"yarn patch:pdpfjs&&node--最大旧空间大小=8192 node_modules/@angular/cli/bin/ng build--prod","build:server":"yarn patch:pdpfjs&&node--最大旧空间大小=8192 node_modules/@angular/cli/bin/ng run kratos:server:production","build:ssr":"yarn build:client--deploy url=//d34t42wpe6kclg.cloudfront.net/client&&yarn build:server&&gulp&&yarn patch:manifest","build:dev:ssr":"yarn build:client&&yarn build:server&&gull","dev:ssr":"yarn patch:pdpfjs&&node--最大旧空间大小=8192 node_modules/@angular/cli/bin/ng run kratos:serve ssr","lint":"ng lint kratos&&纱线lint:style","lint:style":"stylelint\"src/**/*.scss\"-q-o lint-report.json","serve:ssr":"node-dist/server/main.js","检查权限":"进行检查权限","pm2:start":"pm2-start ecosystem.config.json","pm2:stop":"pm2-delete ecosystem.config.json","pm2:重新启动":"pm2重新启动生态系统.config.json","test":"ng test kratos","test:ci":"yarn test--progress=false--watch=false--browsers=ChromeHeadless","test:e2e":"守夜人","test:e2e:ci":"启动服务器并测试start:cihttp-get://localhost:4200测试:e2e","test:e2e:remock":"cross-env remock=1 nightwatch","test:e2e:nofixtures":"cross-env DISABLE_FIXTURES=1 nightwatch","test:e2e:debug":"cross-env debug=nock.*nightwatch","test:e2e:lbo":"cross-env LEAVE_BROWSER_OPEN=1个守夜人","release":"cross-env HUSKY_BYPASS=真标准版","patch:manist":"节点补丁散列资产清单--部署url=//d34t442wpe6kclg.cloudfront.net/client/","webpack:analyze":"yarn patch:pdpfjs&&ng build--prod--statsJson=true&&npx webpack bundle analyzer distbrowser/stats.json","patch:pdpfjs":"node-patch-pdf-worker.js","patch:bootstrap":"node-bootstrap post-install.js","postinstall":"纱线修补程序:引导程序"},"private":true,"预提交":["皮棉","检查权限"],"依赖项":{"@angular/animations":"11.2.14","@angular/cdk":"^11.2.13","@角度/公共":"11.2.14","@angular/compiler":"11.2.14","@角/芯":"11.2.14","@角度/形式":"11.2.14","@角度/本地化":"^11.2.14","@angular/platform browser":"11.2.14","@angular/platform browser dynamic":"11.2.14","@angular/platform server":"11.2.14","@angular/router":"11.2.14","@angular/youtube播放器":"^11.0.4","@commitlint/cli":"11.0.0","@commitlint/config常规":"11.0.0","@ng select/ng select":"5.0.8","@nguniversal/express engine":"10.1.0","@ngx-translate/core":"13.0.0","@ngxs labs/actions executing":"^0.1.9","@ngxs labs/select snapshot":"^3.0.0","@ngxs/devtools-plugin":"^3.7.2","@ngxs/logger插件":"^3.7.2","@ngxs/store":"^3.7.2","@popuperjs/core":"^2.11.2","@types/chart.js":"2.9.37","amazon ivs播放器":"1.2.0","chart.js":"3.8.0","chartjs-plugin-datalabels":"0.7.0","core-js":"^3.6.4","css加载程序":"^0.28.11","日期簿":"^7.0.8","express":"^4.15.2","faker":"^4.1.0","hls.js":"^1.2.0","html实体":"^1.2.1","html加载程序":"^0.5.5","http状态代码":"^1.3.0","哈士奇":"^1.3.1","isbot":"^3.4.6","jwt解码":"^2.2.0","mkdirp":"^0.5.1","移动检测":"^1.4.2","力矩":"^2.22.2","视口中的ng":"^6.1.5","ng2图表":"^3.0.11","ng2工具提示指令":"~22.9.22","ngx captcha":"^8.0.1","ngx剪贴板":"^13.0.1","ngx套筒":"^13.2.0","ngx响应":"^9.0.3","ngx上传程序":"10.0.0","pm2":"^4.4.0","postpass加载程序":"^2.1.5","羽毛笔":"^3.0.3","rxjs":"^6.5.4","socket.io客户端":"^2.3.0","标准版":"9.0.0","子链接":"^1.0.1","tslib":"^2.0.0","ua解析器js":"^1.0.2","video.js":"^7.11.8","zone.js":"0.10.3"},"devDependencies":{"@angular devkit/build angular":"0.1102.19","@angular/cli":"11.2.19","@angular/compiler cli":"11.2.14","@angular/language service":"11.2.14","@angular/service worker":"^11.0.0","@credoweb/phoebe":"0.0.13","@hetznecloud/ngx-translate-mock":"^0.1.0","@nguniversal/builders":"10.1.0","@types/express":"^4.17.0","@types/jasmine":"~3.6.0","@types/jasminewd2":"~2.0.3","@types/lodash":"^4.14.106","@types/node":"^14.0.6","引导程序":"5.1.3","粉笔":"^4.0.0","chromedriver":"^85.0.0","代码分析器":"^6.0.0","cookie分析器":"^1.4.3","cpy-cli":"^1.0.1","cross-env":"^7.0.2","检测浏览器":"5.1.1","dotdot-js":"4.1.0","express":"^4.15.2","吞咽":"^4.0.1","gullow hash":"^4.2.2","http服务器":"^0.10.0","路口观察员":"^0.7.0","茉莉花心":"~3.6.0","茉莉花规格报告者":"~5.0","jsonwebtoken":"~8.5.0","因果报应":"~6.4.1","因果报应铬发射器":"~3.1.0","因果报应报道伊斯坦布尔记者":"~3.0.2","因果报应茉莉花":"~4.0","karma jasmine html记者":"^1.5.0","突变观察者垫片":"^0.3.3","ngx引导程序":"6.2.0","ngx扩展pdf查看器":"^5.0.1","ngx无限滚动":"9.1.0","ngx刷程序包装":"^10.0.0","守夜人":"^1.3.5","nock":"^12.0.3","代理链":"^0.4.5","querystring":"^0.2.0","反映元数据":"^0.1.10","rxjs-compat":"6.6.3","启动服务器并测试":"^1.11.0","stylelint":"^13.8.0","stylelint配置标准":"^20.0.0","滑动器":"^6.3.4","ts加载程序":"8.0.4","ts节点":"9.0.0","tslint":"~6.1.0","typescript":"4.1.6","webpack":"^4.41.6","webpack cli":"^3.1.1","码数":"^13.2.4"}}
angular.json
{"$schema":"./node_modules/@angular/cli/lib/config/schema.json","版本":1,"newProjectRoot":"项目","项目":{"kratos":{"根":","sourceRoot":"src","projectType":"应用程序","建筑师":{"生成":{"builder":"@angular devkit/build angular:浏览器","选项":{"outputPath":"dist/browser","index":"src/index.html","main":"src/main.ts","tsConfig":"src/tsConfig.app.json","showCircularDependencies":false,"polyfills":"src/polyfills.ts","资产":[{"glob":"config.json","input":"src/config","输出":"/"},{"glob":"***","input":"node_modules/ngx扩展pdf查看器/assets/","output":"/assets/"},{"glob":"***","input":"node_modules/aamazon ivs player/dist/assets/","output":"/assets/"},"src/assets","src/vendor","src/langs","src/favicon.ico","src/apple touch icon.png","src/e2e.html","src/legacy索引"],"样式":[{"input":"src/styles/core.scs","bundleName":"核心","注入":true},{"input":"src/styles/bootstrap-custom.scss","bundleName":"bootstrap.custom","注入":true},{"input":"src/styles/shared.scss","bundleName":"已共享","注入":true},{"input":"src/styles/home.scs","bundleName":"home.chunk","注入":true},{"input":"src/styles/publications.scs","bundleName":"publications.chunk","注入":true},{"input":"src/styles/discussions.scs","bundleName":"discussion.chunk","注入":true},{"input":"src/styles/events.scss","bundleName":"events.chunk","注入":true},{"input":"src/styles/topic.scs","bundleName":"topics.chunk","注入":true},{"input":"src/styles/survey.scss","bundleName":"surviews.chunk","注入":true},{"input":"src/styles/profiles.scs","bundleName":"profiles.chunk","注入":true},{"input":"src/styles/notifications.scss","bundleName":"notifications.chunk","注入":true},{"input":"src/styles/contacts.scss","bundleName":"contacts.chunk","注入":true},{"input":"src/styles/settings.scs","bundleName":"settings.chunk","注入":true},{"input":"src/styles/search.scs","bundleName":"search.chunk","注入":true},{"input":"src/styles/chat-campains.scs","bundleName":"chat campaigns.chunk","注入":true},{"input":"src/styles/dashboard.scs","bundleName":"dashboard.chunk","注入":true},{"input":"src/styles/referrence.scs","bundleName":"references.chunk","注入":true},{"input":"src/styles/errors.scss","bundleName":"errors.chunk","注入":true},{"input":"src/styles/static.scss","bundleName":"static.chunk","注入":true},{"input":"src/styles/authentication.scs","bundleName":"authentication.chunk","注入":true},{"input":"src/styles/curses.scss","bundleName":"courses.chunk","注入":true},{"input":"src/styles/promotions.scs","bundleName":"promotion.chunk","注入":true},{"input":"src/styles/credoweb.scss","bundleName":"credoweb.chunk","注入":true}],"脚本":[{"input":"node_modules/mutationobserver shim/dist/mutationobserver.min.js","bundleName":"突变观察者","注入":true},{"input":"node_modules/cointersection observer/contersection observer.js","bundleName":"交集观测器","注入":true},{"input":"node_modules/dottdot-js/dist/dottdot.js","bundleName":"dotdot-js","注入":true},{"input":"node_modules/aamazon-ivs player/dist/assets/aamazon ivs wasmworker.min.js","bundleName":"amazon ivs wasmworker.min","注入":true}]},"配置":{"生产":{"优化":真,"outputHashing":"all","sourceMap":false,"namedChunks":false,"aot":true,"extractLicense":true,"vendorChunk":没错,"buildOptimizer":true,"文件替换":[{"replace":"src/environment/environment.ts","with":"src/environment/environment.prod.ts"}]},"发球":{}}},"发球":{"builder":"@angular devkit/build angular:dev-server","选项":{"browserTarget":"kratos:build:serve"},"配置":{"生产":{"browserTarget":"kratos:build:production"}}},"extract-i18n":{"builder":"@angular devkit/build angular:extract-i18n","选项":{"browserTarget":"kratos:build"}},"测试":{"builder":"@angular devkit/build angular:因果报应","选项":{"main":"src/test.ts","karmaConfig":"./src/karma.conf.js","polyfills":"src/polyfills.ts","tsConfig":"src/tsConfig.spec.json","样式":["src/styles/main.scs"],"资产":["src/assets","src/vendor","src/langs","src/favicon.ico"]}},"皮棉":{"builder":"@angular devkit/build angular:tslint","选项":{"tsConfig":["src/tsconfig.app.json"],"排除":["**/nod_module/**"]}},"服务器":{"builder":"@angular devkit/build angular:server","选项":{"outputPath":"dist/server","main":"server.ts","tsConfig":"src/tsConfig.server.json","showCircularDependencies":false},"配置":{"生产":{"文件替换":[{"replace":"src/environment/environment.ts","with":"src/environment/environment.prod.ts"}]}}},"服务ssr":{"builder":"@nguniversal/builders:ssr dev-server","选项":{"browserTarget":"kratos:build","serverTarget":"kratos:server"},"配置":{"生产":{"browserTarget":"kratos:build:production","serverTarget":"kratos:server:production"}}},"prerender":{"builder":"@nguniversal/builders:prerender","选项":{"browserTarget":"kratos:build:production","serverTarget":"kratos:server:production","路线":["/"]},"配置":{"生产":{}}}}},"kratos-e2e":{"根":"e2e","sourceRoot":"e2e","projectType":"应用程序","建筑师":{"e2e":{"builder":"@angular devkit/build angular:量角器","选项":{"productorConfig":"./e2e/productor.conf.js","devServerTarget":"kratos:serve"}},"皮棉":{"builder":"@angular devkit/build angular:tslint","选项":{"tsConfig":[],"排除":["**/nod_module/**"]}}}}},"原理图":{"@示意图/角度:class":{"skipTests":true},"@示意图/角度:组件":{"skipTests":false,"inlineStyle":true,"inlineTemplate":false,"prefix":"app","样式":"scss"},"@示意图/角度:指令":{"skipTests":true,"前缀":"应用程序"},"@示意图/角度:防护":{"skipTests":true},"@示意图/角度:模块":{"skipTests":true},"@示意图/角度:管道":{"skipTests":true},"@示意图/角度:服务":{"skipTests":true}},"defaultProject":"kratos","cli":{"分析":false}}
关闭此威胁。经过几天的版本来回切换,什么都不起作用。我决定升级到angular 12,一切又开始工作了。没有角度11的分辨率。