'Cannot resolve @fontawesome all / fontawesome-free
Solution 1:[1]
I simply solve the error by uninstall the googlefonts then again reinstall the google fonts by using following command.In my case I am using yarn so I use
yarn add @fortawesome/fontawesome-free
But in case of user that are using npm they should use following command
npm install --save @fortawesome/fontawesome-free
Also the following link is helpful google solve links for Npm and Yarn
Solution 2:[2]
Make sure to have the .css
extension, otherwise the import will fail.
As a reminder:
Install @fortawesome/fontawesome-free
(with npm or yarn depending on what package manager your project uses).
Then in your main.js you can just import all.css
as per the example below
import Vue from 'vue'
import App from './App.vue'
import '@fortawesome/fontawesome-free/css/all.css'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
This will allow you to use the fa
classes in regular HTML tags.
I also recommend taking a look at the Vue supported library for FontAwesome here if you want to have more granularity with your imports.
https://github.com/FortAwesome/vue-fontawesome
Solution 3:[3]
If you are using yarn then put this command
yarn add @fortawesome/fontawesome-free
or
If you are using npm then put this command
yarn add @fortawesome/fontawesome-free
and add
@import '@fortawesome/fontawesome-free/css/all.css';
this in app.scss file
or add import '@fortawesome/fontawesome-free/css/all.css';
in app.js file
Solution 4:[4]
This one worked for me, I Downgraded @fortawesome/fontawesome-free version to ^5.15.4 in the package.json
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Muhammad Numan |
Solution 2 | kissu |
Solution 3 | Hamed Hajiloo |
Solution 4 | Naveen Kamath |