react-fontawesome icon indicating copy to clipboard operation
react-fontawesome copied to clipboard

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

Open ryuujo opened this issue 5 years ago • 33 comments

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.

ryuujo avatar May 02 '19 04:05 ryuujo

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

Namchee avatar May 03 '19 02:05 Namchee

@Namchee is right, this is the problem.

ryandrew14 avatar May 03 '19 14:05 ryandrew14

Thanks @Namchee the problem has been solved! ^^

ryuujo avatar May 08 '19 04:05 ryuujo

Thanks @Namchee the problem has been solved! ^^

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

hridoyraisul avatar Aug 24 '20 13:08 hridoyraisul

@hridoyraisul check the package namespace @fortawesome not @fontawesome "R" versus "N"

robmadole avatar Aug 24 '20 15:08 robmadole

@hridoyraisul check the package namespace @fortawesome not @fontawesome "R" versus "N"

Thanks a lot ,, I fixed it

hridoyraisul avatar Aug 24 '20 15:08 hridoyraisul

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

image

amastaneh avatar Jan 19 '21 00:01 amastaneh

I have faced the same issue. Even I used the folder name correctly as '@fortawesome', still, there is an error showing as 'Module not found: Can't resolve'

Afsana1313 avatar Feb 25 '21 04:02 Afsana1313

@Afsana1313 paste the error please and I'll take a look. I need to see if exactly.

robmadole avatar Feb 25 '21 18:02 robmadole

still not solved. this is my importing code: import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

hasansiam45 avatar Feb 26 '21 06:02 hasansiam45

@Afsana1313 @hasansiam45 please provide a reproducible example (something we can run npm install on) and we'll take a look.

robmadole avatar Feb 26 '21 18:02 robmadole

Now I tried to introduce fontawesome myself. But I fail I tried to go after the installation and use guide. But it doesn't work out.

NsdHSO avatar Mar 10 '21 11:03 NsdHSO

@NsdHSO you'll have to give us some additional details. If it doesn't match this issue ("Module not found: Can't resolve '@fontwesome/react-fontawesome'") then please open a new issue in this project.

robmadole avatar Mar 10 '21 16:03 robmadole

@robmadole I configured it out, I had to give it an npm i. Tanks anyway.

NsdHSO avatar Mar 11 '21 23:03 NsdHSO

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

srikanthch1919 avatar Apr 13 '21 05:04 srikanthch1919

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

sergio-ivanuzzo avatar Jun 09 '21 19:06 sergio-ivanuzzo

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.

NsdHSO avatar Jun 11 '21 11:06 NsdHSO

Try this is
npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome

Ravindrakumara avatar Jun 21 '21 14:06 Ravindrakumara

Try this is npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome this one was very useful for the case

hilminomad avatar Jun 23 '21 10:06 hilminomad

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.

Damemo avatar Jun 30 '21 11:06 Damemo

After installing forntawsome globally by Command Prompt you have to install in your current working project singly.then it will work

ghost avatar Dec 14 '21 16:12 ghost

Just wanted to say this worked for me, using Yarn, and it totally solved the issue. Thanks guys!

jmartincc avatar Feb 15 '22 20:02 jmartincc

Try this is npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome

This Really Helped. Thanks Man 😄

aliasr2001 avatar Mar 31 '22 16:03 aliasr2001

Try this is npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome

Thanks a lot I was searching on the web for 2 hours and yours just solved the problem.

oracularzebra avatar May 23 '22 05:05 oracularzebra

excellent solution on problem

Global-Manu-Man avatar Jun 05 '22 04:06 Global-Manu-Man

My case was when I was using the version 6.0.0. I fixed change the version to a valid tag version here: https://www.npmjs.com/package/@fortawesome/fontawesome-svg-core In my case was 6.2.0

matheuscaet avatar Oct 04 '22 01:10 matheuscaet

Try this is npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome

dude you saved my life

coffeecode27 avatar Mar 01 '23 00:03 coffeecode27

Try this is npm i --save @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome

Tks so much , you helped handle issue

RinkaMizuki avatar Mar 20 '23 07:03 RinkaMizuki

Hey I am facing the same issue. Screenshot 2023-03-25 121928

ambasth05aruni avatar Mar 25 '23 06:03 ambasth05aruni

Module not found: Error: Can't resolve '@fortawsome/react-fontawsome' in 'C:\Users\User\Desktop\onlineshop\shop\src\components' i have this problem and i didnt fixed with npm i ........ could you help me pls?

Kimiaghasemian avatar Sep 09 '23 18:09 Kimiaghasemian