英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论