无法解析’@fortawesome/free-regular-svg-icons’。

huangapple go评论58阅读模式
英文:

Can't resolve '@fortawesome/free-regular-svg-icons'

问题

I'm using fontawesome icons with my React app, and I'm trying to install them globally. Where should I specifically include the library containing the icons like this in my app?

我正在使用 fontawesome 图标在我的 React 应用中,并尝试在全局范围内安装它们。在我的应用程序中,我应该在哪里特别包含包含这些图标的库,就像这样:

import { library } from '@fortawesome/fontawesome-free';
library.add(faFontAwesome);
英文:

I'm using fontawesome icons with my React app, and I'm trying to install them globally.
Where should I specifically include the library containing the icons like this in my app?

import { library } from '@fortawesome/fontawesome-free';
library.add(faFontAwesome)

答案1

得分: 3

这有点难以确定,因为细节太少,但如果您使用npm,应使用以下命令安装它们:

npm install @fortawesome/fontawesome-free

要全局安装它们,您可以使用--global-g命令:

npm install --global @fortawesome/fontawesome-free
英文:

It's a bit difficult to say with so few details, but if you are using npm you should install them with the following command:

npm install @fortawesome/fontawesome-free

To install them globally you use the --global or -g command:

npm install --global @fortawesome/fontawesome-free

huangapple
  • 本文由 发表于 2023年6月25日 18:02:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76549842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定