简体   繁体   中英

Getting error in react after installing fontawesome through npm

i have installed fontawesome by following these steps by visiting their website.

npm i --save @fortawesome/fontawesome-svg-core

npm install --save @fortawesome/free-solid-svg-icons

npm install --save @fortawesome/react-fontawesome

and now am getting this error

./node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js Error: ENOENT: no such file or directory, open 'C:\Users\HP\Desktop\practice site\javascript\REACT\Codingworld\node_modules\react-scripts\node_modules@pmmmwh\react-refresh-webpack-plugin\lib\runtime\RefreshUtils.js'

Help me to solve my error

Please try this one. I hope to solve it. if it solves please comment on my answer.

install font-awesome for react

The error message says that it's looking for a file RefreshUtils.js in the directory C:\Users\HP\Desktop\practice site\javascript\REACT\Codingworld\node_modules\react-scripts\node_modules@pmmmwh\react-refresh-webpack-plugin\lib\runtime but doesn't find it.

This file is part of the npm package @pmmmwh/react-refresh-webpack-plugin .

It could be that you previously installed this package, or that this package is a dependency for another package you're using (eg react-scripts).

Your question doesn't include sufficient information, such as the content of your package.json file, and specifying which command is giving the error.

There could be various reasons causing the error:

  • Running the command from the wrong folder

    In this case, navigate to the correct folder in your terminal, then run the command.

  • Issues in your dependencies

    In this case, given that you have a package.json file in your project folder, reinstall all your dependencies:

    1. Delete the node_modules folder and the package-lock.json file

    2. Run npm cache clean

    3. Run npm install

Given that you're running the command from the correct folder and your dependencies are up-to-date, the error should go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM