react-fontawesome: Module not found: Can't resolve '@fontwesome/react-fontawesome'

I got an error while importing FontAwesome. Here’s the error:

./src/routes/Home/Home.jsx Module not found: Can’t resolve ‘@fontwesome/react-fontawesome’ in ‘C:\selfProject\faq-page\src\routes\Home’

This is my code (I just only importing it):

import React, { Component } from "react";
import { FontAwesomeIcon } from "@fontwesome/react-fontawesome";
import { faSearch } from "@fortawesome/free-solid-svg-icons";

import "./Home.css";

class Home extends Component {
  render() {
    return (
      <div className="home">
        <div className="container container-title">
...

I already tried to remove node_modules and yarn.lock and tried to re-install it again, but still have the same issue.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 33 (5 by maintainers)

Most upvoted comments

Faced with similar issue, for me helped to install @fortawesome/fontawesome-svg-core

I think the import path is wrong. Shouldn’t it be @fortawesome/<write module here> and not @fontwesome/<write module here>?

Refer to: https://github.com/FortAwesome/react-fontawesome#installation

Thanks i resolved this problem YOU have a good day.

Faced with similar issue, for me helped to install @fortawesome/fontawesome-svg-core

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Thanks @Namchee the problem has been solved! ^^

please tell me how it solved? I have the same problem.

excellent solution on problem

I have faced the same issue. Even I used the folder name correctly as import { FontAwesomeIcon } from “@fortawesome/react-fontawesome”; this is the error:Module not found: Can’t resolve ‘@fortawesome/react-fontawesome’ in ‘E:\react-music\src\components’ codeimg-facebook-shared-image

Faced with similar issue, for me helped to install @fortawesome/fontawesome-svg-core

Thanks, helped me resolve same issues in multiple files at once due to this.

It’s part of the NPM installation guideline in https://www.npmjs.com/package/@fortawesome/free-solid-svg-icons

image