Konrad Viltersten
Konrad Viltersten

Reputation: 39058

How to pick correct version of FontAwesome for Angular using the package

FontAwesome has released an Angular specific package and I want to give it a try instead of the usual linkage from a CDN server. According to the instruction, I'm supposed to install it using the following command.

# See Compatibility table below to choose correct version
$ npm install @fortawesome/angular-fontawesome@<version>

The compatibility table states that I'm supposed to use version 0.3.x if I'm running Angular version 7.x. Checking the file package.json, I can see that I'm using "@angular/core": "7.2.5", which I'm interpreting to version 0.3.2 for FontAwesome. However, running the command

npm install @fortawesome/[email protected]

resulted in error about no matching version (which indeed is true). I've tried a bunch of different combinations with no luck.

What am I missing?

Upvotes: 3

Views: 3868

Answers (2)

nash11
nash11

Reputation: 8650

I'm not sure as to why you've interpreted @angular/core: "7.2.5" to mean you have to install FontAwesome version 0.3.2. The 2 here is just the patch version and it's not necessary that FontAwesome even needed to make any changes while angular updated their versions.

You can just install it without specifying the patch version. This will by default install the latest patch version and since you need to use FontAwesome version 0.3.x, the patch version doesn't really matter anyway. The only requirement here is that the minor version should be 3.

npm install @fortawesome/[email protected]

Upvotes: 3

Daniel Danielecki
Daniel Danielecki

Reputation: 10502

Using on Angular 8.2.0. Have the following versions in my package.json:

"@fortawesome/angular-fontawesome": "^0.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.17",
"@fortawesome/free-brans-svg-icons": "^5.8.1",
"@fortawesome/free-solid-svg-icons": "^5.8.1"

On Angular 7.2.15, the only one difference I had was "@fortawesome/angular-fontawesome": "^0.3.0".

Upvotes: 3

Related Questions