You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On importing import {machineId, machineIdSync} from 'node-machine-id' in app component then getting this error. Any work around for the same.
ERROR in ./node_modules/node-machine-id/dist/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\Users\farhan\Desktop\ Farhan\Projects\BFMC\BFMClient\node_modules\node-machine-id\dist'
The text was updated successfully, but these errors were encountered:
I had the same problem, I think. You are probably using machineIdSync in the Electron renderer process? child_process is a node module and can only be accessed from the main process.
Faced with the same problem I did some research. With inspiration from https://stackoverflow.com/questions/54459442/module-not-found-error-cant-resolve-child-process-how-to-fix I solved it for the rendering process by adding following config for webpack.config.js. After this change I get a machine id when running a build electron app, when running "serve" it fails with an exception at execution but that is ok for me. node: { child_process: "empty" }
On importing import {machineId, machineIdSync} from 'node-machine-id' in app component then getting this error. Any work around for the same.
ERROR in ./node_modules/node-machine-id/dist/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\Users\farhan\Desktop\ Farhan\Projects\BFMC\BFMClient\node_modules\node-machine-id\dist'
The text was updated successfully, but these errors were encountered: