luigiplr / node-hotspot

Manage, Add & Remove infrastructure mode hotspots on Windows & OSX, WIP: Linux
GNU General Public License v3.0
27 stars 10 forks source link

Usage on electron #15

Closed kisinga closed 5 years ago

kisinga commented 5 years ago

I'm getting the error Module not found: Error: Can't resolve 'child_process' in when I try to use it on electron I'm executing it from the main electron js file Any help will be appreciated

tobeorla commented 5 years ago

Could you list the complete error? Just to see the line where it happens. And could you also list the version you're using and how you set it up?

kisinga commented 5 years ago

Thank you for the response This is the error ERROR in ./node_modules/node-hotspot/build/utils/windows.js Module not found: Error: Can't resolve 'child_process' in '/home/kisinga/Taekwondo/node_modules/node-hotspot/build/utils' ERROR in ./node_modules/node-hotspot/build/utils/windows.js Module not found: Error: Can't resolve 'path' in '/home/kisinga/Taekwondo/node_modules/node-hotspot/build/utils' I'm running it on a Ubuntu 18.10 and electron 4.0.4 and Angular 7.2.4 Essentially I'd like to use the code within angular, although even importing it from within the main electron js file produces the same error

tobeorla commented 5 years ago

That's quite strange, what node version do you have? If you create a index.js somewhere else with var _child_process = require('child_process'); as content and do run index.js does it show the same error? Or doesn't output anything?

child_process is a native node module you should have it : S, doesn't seem to be a problem with node-hotspot package itself.

kisinga commented 5 years ago

You are right! After some research I found out that electron doesnt directly play well with angular unless some modifications are made to the structure of the app I found a very good starting point for the same and eventually had to change a lot to run it without errors I'm however still not able to successfully start a hotspot on linux I dived into the code and so far most of those methods are empty, could that be the reason?

tobeorla commented 5 years ago

Yes, this lib only covers Windows 7+ as stated in https://github.com/luigiplr/node-hotspot#wip-node-hotspot :) Feel free to push any improvements :)

kisinga commented 5 years ago

Closing this issue and opening a new one for integration with linux