Back to blog
Havish Logo
havish
published on 2025-03-15 • 5 min read

How to get FontAwesome Pro to work with Vercel deployment

Whilst making this website, I opted to use FontAwesome's icons as they have such an expansive library available.

On top of that, I decided to use their Pro library, however once deploying, the build would fail with Vercel due to a lack of permissions to install the required packages.

Solution

The simplest way to resolve this is to create a .npmrc file at the root of your Next.js application, like so:

.npmrc
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=YOUR_FONTAWESOME_TOKEN_HERE
  • You can find your token here.

Once you've added this file to your project root, Vercel will be able to authenticate with FontAwesome's npm registry during the build process and successfully install your Pro packages.

Additional Tips

Make sure to add your .npmrc file to your .gitignore if you're committing your auth token directly, or better yet, use environment variables in production for enhanced security.

This solution works for any private npm registry, not just FontAwesome Pro. The key is providing the proper authentication credentials in your .npmrc file.