Unable to resolve module node:http
See original GitHub issueDescription?
I’m working on a ReactNative app, and I was trying to make an HTTP request on an API. The implementation in use works fine (I’ve been using it for a while now).
But with this new version 3.2.0
, when i import the file, I immediately get
Unable to resolve module node:http
in my the console cmd
,
and also this suggestion below.
If you are sure the module exists, try these steps:
- Clear watchman watches: watchman watch-del-all
- Delete node_modules and run yarn install
- Reset Metro’s cache: yarn start --reset-cache
- Remove the cache: rm -rf /tmp/metro-*
Reproduction Steps to reproduce the behavior:
- yarn add node-fetch
- run the code above ( image )
Expected behavior
Screenshots
Your Environment
software | version |
---|---|
node-fetch | 3.2.0 |
node | 16.13.1 |
npm | 8.1.2 |
Operating System | Mac OS X (macOS) |
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Unable to resolve some modules - node:http [solved]
I haven't noticed anything not working. => Started proxy. => Started HMR server. => Started MongoDB. Unable to resolve some modules: "node:http" ...
Read more >Unable to resolve module node:http - javascript - Stack Overflow
reverting back to 2.6.1 worked for me, I had a similar error where node:buffer could not be found.
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
In this article, I'm going to show you how to fix the error. Why the "Error: cannot find module" Occurs. This error occurs...
Read more >How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run ` npm install` again :D Follow me on Twitter: ...
Read more >CommonJS modules | Node.js v19.3.0 Documentation
node. If these attempts fail, then Node.js will report the entire module as missing with the default error: Error: Cannot find ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
reverting back to 2.6.1 worked for me, I had a similar error where ‘node:buffer could not be found’
Work-around?
if in need, reverted back to node-fetch
^2.6.1
, it works fine