tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
614 stars 114 forks source link

what is shim ? #120

Open pradeepsimba opened 1 year ago

pradeepsimba commented 1 year ago

I am new to reat-native.

I want to use http module in my project.

But , How can I use rn-nodeify ?.

What is shim ?

This is my project.

I add npm install @tradle/react-native-http in my project.

But , I have this error.

enter image description here

 [Error: undefined Unable to resolve module url from C:\Users\mahima\Desktop\react- 
native\httpmob\node_modules\@tradle\react-native-http\index.js: url could not be found within the project or in these directories:
  node_modules
  ..\..\..\node_modules
   6 | var EventEmitter = require('events').EventEmitter
   7 | var Request = require('./lib/request')
>  8 | var url = require('url')
     |                    ^
   9 | var defaults = {
   10 |     port: 80,
   11 |     protocol: 'http:']
 Error: Unable to resolve module url from C:\Users\mahima\Desktop\react- 
 native\httpmob\node_modules\@tradle\react-native-http\index.js: url could not be found within the project or in these directories:
  node_modules
  ..\..\..\node_modules
   6 | var EventEmitter = require('events').EventEmitter
   7 | var Request = require('./lib/request')
>  8 | var url = require('url')
     |                    ^
   9 | var defaults = {
  10 |     port: 80,
  11 |     protocol: 'http:'

How can I solve this error ?