agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux
MIT License
618 stars 93 forks source link

Error in using Electron Forge packaging in Electron application #213

Closed dreamOf closed 2 months ago

dreamOf commented 2 months ago

n the Electron application, using "npm run start "results in an error message as follows(package.json: "start": "electron-forge start"): E:\test\my-new-app>npm run start

my-new-app@1.0.0 start electron-forge start

√ Checking your system √ Locating application √ Loading configuration × Preparing native dependencies: 0 / 1 › node-gyp failed to rebuild 'E:\test\my-new-app\node_modules\edge' ■ Running generateAssets hook

› Traceback (most recent call last): File "E:\test\my-new-app\node_modules@electron\rebuild\node_modules\node-gyp\gyp\gyp_main.py", line 42, in import gyp # noqa: E402 ^^^^^^^^^^ File "E:\test\my-new-app\node_modules@electron\rebuild\node_modules\node-gyp\gyp\pylib\gypinit.py", line 9, in import gyp.input File "E:\test\my-new-app\node_modules@electron\rebuild\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in from distutils.version import StrictVersion ModuleNotFoundError: No module named 'distutils' Error: gyp failed with exit code: 1 at ChildProcess.onCpExit (E:\test\my-new-app\node_modules@electron\rebuild\node_modules\node-gyp\lib\configure.js:325:16) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:294:12)

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

An unhandled rejection has occurred inside Forge: Error: node-gyp failed to rebuild 'E:\test\my-new-app\node_modules\edge' at ChildProcess. (E:\test\my-new-app\node_modules@electron\rebuild\lib\module-type\node-gyp\node-gyp.js:118:24) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:294:12)

agracio commented 2 months ago

I am not 100% sure what you are trying to do here but a few points to consider