automation-stack / node-machine-id

Unique machine (desktop) id (no admin privileges required)
MIT License
582 stars 62 forks source link

Can't resolve 'child_process' in ' \node_modules\node-machine-id\dist' on Angular Electron #41

Open didiokener opened 4 years ago

didiokener commented 4 years ago

When I implement this package on Angular Electron from https://github.com/maximegris/angular-electron, I get the same error of issue #29, but I am using Angular not Vue.js. I already tried verify if the application is Electron to execute the method machineId only when running on Electron, like, if (isElectron) id = machineIdSync(); But it is running into the same error. Thanks for listening.

pjebs commented 4 years ago

I get the same error in the renderer process. I'm not using any front end framework.

I haven't tried it yet, but I'm planning to run node-machine-id in the main process and just pass the data to the render to try and overcome this issue I haven't been able to resolve.

pjebs commented 4 years ago

Perhaps related to: https://github.com/automation-stack/node-machine-id/issues/29

danielehrhardt commented 3 years ago

Use remote.require('node-machine-id'); import { ElectronService as NgxService } from 'ngx-electron'; image