chuckd
chuckd

Reputation: 14540

using npm in Visual Studio Code doesn't get the fontawesome css files

I'm new to Angular and running through a Udemy tutorial and trying to install fontawesome using npm.

I used 'npm install fontawesome' I also tried 'npm install --save-dev @fortawesome/fontawesome-free'

enter image description here

and now when I try to reference the min.css file like the image below I don't have the files. I checked the folder and they don't exist!

Did I not install it correctly?

enter image description here

Upvotes: 0

Views: 2359

Answers (2)

danielless
danielless

Reputation: 11

Please see the following screenshots. This worked for me:

First image

Second image

Third image

Upvotes: 0

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24424

This way work for me

inslall the fortawesome 5.x package

npm install @fortawesome/fontawesome-free

in global style.scss add this

@import "@fortawesome/fontawesome-free/css/all.css";

or this

@import '../node_modules/@fortawesome/fontawesome-free/css/all.css';

another way by using cdn

just add thi like to index.html

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="ano nymous">

demo 🌟

Upvotes: 3

Related Questions