luigiplr/node-hotspot

Usage on electron

Closed this issue · 6 comments

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

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?

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

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.

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?

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

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