jimmywarting / wemo-client

JavaScript client library for controlling and subscribing to Wemo Devices
MIT License
132 stars 40 forks source link

wemo-client error resolve bundle (please help me i really need this module) #74

Open Greta-Calamari opened 1 year ago

Greta-Calamari commented 1 year ago

I found this library wemo-client that recognize Wemo devices so i can use them in the application , i installed it with yarn add wemo-client , but when i use the snippets in my home component and i start the application it gives me this error:

error: Error: While trying to resolve module http from file /Users/user/lavoro/appname/node_modules/wemo-client/index.js, the package /Users/user/lavoro/appname/node_modules/http/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/gretacalamari/lavoro/appname/node_modules/http/index. Indeed, none of these files exist:

/Users/user/lavoro/appname/node_modules/http/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
/Users/user/lavoro/appname/node_modules/http/index/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) at DependencyGraph.resolveDependency (/Users/user/lavoro/appname/node_modules/metro/src/node-haste/DependencyGraph.js:376:17) at Object.resolve (/Users/user/lavoro/appname/node_modules/metro/src/lib/transformHelpers.js:271:42) at resolve (/Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:571:33) at /Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:587:26 at Array.reduce () at resolveDependencies (/Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:586:33) at /Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33 at Generator.next () at asyncGeneratorStep (/Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24) at _next (/Users/user/lavoro/appname/node_modules/metro/src/DeltaBundler/traverseDependencies.js:107:9)

here in my home screen:

import Wemo from 'wemo-client'
 const wemo = new Wemo()

  wemo.discover((err, deviceInfo) => {
    console.log('Wemo Device Found: %j', deviceInfo)
    const client = wemo.client(deviceInfo)
    client.on('error', (err) => {
      console.log('Error: %s', err.code)
    })
    client.on('binaryState', (value) => {
      console.log('Binary State changed to: %s', value)
    })
    client.setBinaryState(1)
  })

i tried to remove node modules then yarn , update and downgrade http and url but none of these steps work. can you help me , if you need if i will give them to you very greatfully