question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve module node:http

See original GitHub issue

Description?

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).

Screen Shot 2022-01-29 at 20 46 47

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:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules and run yarn install
  3. Reset Metro’s cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*

Reproduction Steps to reproduce the behavior:

  1. yarn add node-fetch
  2. run the code above ( image )

Expected behavior

Screenshots Screen Shot 2022-01-29 at 20 51 57

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PowVTcommented, Feb 1, 2022

reverting back to 2.6.1 worked for me, I had a similar error where ‘node:buffer could not be found’

1reaction
kabundegecommented, Jan 29, 2022

This is a problem with React Native and the bug should be reported to Facebook

Work-around?

if in need, reverted back to node-fetch ^2.6.1 , it works fine

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found