每当我尝试使用 <fa-icon [icon]="[someIconName]"></fa-icon>
时,我都试图在我的 Angular-13 应用程序中使用超棒的字体图标,它会引发以下错误。我无法使用任何超棒的字体图标。请帮我解决一下这个。我进一步删除 node_module
文件夹,然后重新安装它但无法修复它。
./node_modules/bootstrap/dist/css/bootstrap.min.css.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet 1 .rules[5].rules[ 0].oneOf[0].use 1 !./node_modules/postcss-loader/dist/cjs.js??ruleSet 1 .rules[5].rules[0].oneOf[0].use[2]!. /node_modules/bootstrap/dist/css/bootstrap.min.css
- 警告:模块警告(来自./node_modules/postcss-loader/dist/cjs.js):警告
(6:29521) autoprefixer:将颜色调整替换为打印颜色调整。 color-adjust 简写目前已弃用。
./node_modules/@fortawesome/angular-fontawesome/fesm2015/angular-fontawesome.mjs
- 错误:模块构建失败(来自 ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):类型错误:无法在字符串“C:\Users\ALTrakesg2\Downloads”上创建属性“消息” \Employee-feedback-management-system\frontend\node_modules@fortawesome\angular-fontawesome\fesm2015\angular-fontawesome.mjs:此应用程序依赖于使用 Angular 版本 14.0.0 发布的库,它需要 Angular 版本 14.0.0 或更新版本才能正常工作。考虑升级您的应用程序以使用更新版本的 Angular。 134 | } 135 | FaStackItemSizeDirective。
136 | FaStackItemSizeDirective。 : { stackItemSize: “stackItemSize”, size: “size” }, usesOnChanges: true, ngImport: i0 }); | ^^^^^^^^^^9m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^9m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^9m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ 137 | i0。 :\Users\ALTrakesg2\Downloads\Employee-feedback-management-system\frontend\node_modules@babel\core\lib\transformation\index.js:37:15) at run.next () at Function.transform (C:\ Users\ALTrakesg2\Downloads\Employee-feedback-management-system\frontend\node_modules@babel\core\lib\transform.js:25:41) at transform.next () at step (C:\Users\ALTrakesg2\Downloads\员工反馈管理系统\前端\节点模块\gensync\index.js:261:32) 在 C:\Users\ALTrakesg2\Downloads\员工反馈管理系统\前端\节点模块\gensync\index.js: 273:13 在 async.call.result.err.err (C:\Users\ALTrakesg2\Downloads\Employee-feedback-management-system\frontend\node_modules\gensync\index.js:223:11) 在 C:\Users \ALTrakesg2\Downloads\Employee-feedback-management-system\frontend\node_modules\gensync\index.js:37:40
错误:node_modules/@fortawesome/angular-fontawesome/icon/duotone-icon.component.d.ts:54:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
54 static ɵcmp: i0.ɵɵComponentDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/icon/icon.component.d.ts:66:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
66 static ɵcmp: i0.ɵɵComponentDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/layers/layers-counter.component.d.ts:20:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
20 static ɵcmp: i0.ɵɵComponentDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/layers/layers-text.component.d.ts:32:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
32 static ɵcmp: i0.ɵɵComponentDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/layers/layers.component.d.ts:18:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
18 静态 ɵcmp: i0.ɵɵComponentDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/stack/stack-item-size.directive.d.ts:11:18
- 错误 TS2314:通用类型“ɵɵDirectiveDeclaration”需要 6 个类型参数。
11 static ɵdir: i0.ɵɵDirectiveDeclaration
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 错误:node_modules/@fortawesome/angular-fontawesome/stack/stack.component.d.ts:18:18
- 错误 TS2314:通用类型“ɵɵComponentDeclaration”需要 7 个类型参数。
18 static ɵcmp: i0.ɵɵComponentDeclaration
;
先感谢您
原文由 Rakesh Gombi 发布,翻译遵循 CC BY-SA 4.0 许可协议
在没有更多信息的情况下很难猜测错误,但遵循错误消息:
TypeError: Cannot create property 'message' on string 'C:\Users\ALTrakesg2\Downloads\Employee-feedback-management-system\frontend\node_modules\@fortawesome\angular-fontawesome\fesm2015\angular-fontawesome.mjs:
此应用程序依赖于使用 Angular 版本 14.0.0 发布的库,它需要 Angular 版本 14.0.0 或更高版本才能正常工作。看起来您需要升级
Angular
版本才能使用您当前的@fortawesome
库版本。