Module not found: Error: Can't resolve 'unfetch' - reactjs

My first time using react and unfetch and im following a course. Couldnt find a solution on this particularly.
So i import unfetched with
import fetch from 'unfetch';
But when i run yarn start
i get
Module not found: Error: Can't resolve 'unfetch' in 'C:\Users\yigit\Desktop\demo\js\src'
when i hover over unfetch in my code it says module "c:/Users/yigit/Desktop/demo/js/node_modules/unfetch/src/index"
and the folder does exist and unfetch is in my package.json as
"unfetch": "^5.0.0",
Has anyone else encountered it and how can i solve it?
Btw: i did run npm fix audit didnt work.

https://github.com/developit/unfetch/pull/164
version 5.0.0 has an export bug
because of that I am using version 4.2.0

Related

React Module not found

I have installed an npm package on my react application but everytime I try to compile I get this error:
Module not found: Error: Can't resolve 'serialport' in 'C:\Users\Username\Desktop\ProjectGroup\c-test\src'
I have checked the node_modules folder and it is in fact in that folder.
i have also tried to install it again but it still throws the same error.
How would I go about fixing this?
As shown in comments, you installed only the types which are usefull for TypeScript.
Run npm i serialport

create-react-app error while using yarn 3

I'm using yarn 3.2.0(latest) and node 17.6.0(latest)
As instructed in CRA documentation I ran yarn create react-app myapp. It completed installation and was able to start the app using yarn start. However after making changes to the App , I always get the following error
ERROR
Failed to load config "react-app" to extend from.
Referenced from: D:\myapp\package.json
If I install any packages, I get module not found error like below
ERROR in ./src/App.js 6:0-39
Module not found: Error: Can't resolve 'styled-components' in 'D:\myapp\src'
Anyone know what's going on?
I had a similar issue. And found that the reason why this was happening to me was due to my Antivirus. Try disabling your antivirus on windows if you have one and re-create your project and if that fixes your issue.

How do I link the node module correctly in react native

I have ran npm install #ant-design/react-native --save but I keep getting the error below:
error: Error: Unable to resolve module `#react-native-community/viewpager`
from `node_modules/#ant-design/react-native/lib/carousel/index.js`:
#react-native-community/viewpager could not be found within the project.
Why is happening? How do I fix this?

Module not found: Can't resolve 'redux' : "./node_modules/react-redux/es/connect/mapDispatchToProps.js"

After installing redux trying to run application but getting error like "can't find the module" in mapDispatchToProps.js which is available in nodemodule folder.
Hi Please run below command.
npm install --save redux react-redux
It should solve your problem.

Module not found: Can't resolve '#babel/runtime/core-js/array/from'

I am new to react and I have this problem when trying to use react-bootstrap.
I've installed react-bootstrap, reactstrap and react-bootstrap-select, and the problem is that when I try to import something from react-bootstrap I get this error:
./node_modules/react-bootstrap/es/DropdownMenu.js Module not found:
Can't resolve '#babel/runtime/core-js/array/from' in
'C:\webprojects\react\mytest-app\node_modules\react-bootstrap\es'
I removed the line calling this script and I got another similar error, but that mentions another script.
I have searched in many placed on the web and installed babel-runtime and I tried npm install but nothing seems to work. If I go to the mentioned folder I find these scripts. I don't really know what to do or what is the exact problem here.
Any help would be appreciated.
This looks like a recently introduced bug you are hitting, making the current 0.32.2 version of react-bootstrap incompatible with the babel version used:
https://github.com/react-bootstrap/react-bootstrap/issues/3231
We temporarily fixed the react-bootstrap version in package.json to 0.32.1 as a workaround.

Resources