Skip to content

Commit

Permalink
https://www.update.rocks/blog/fixing-the-python3/
Browse files Browse the repository at this point in the history
If you are using electron-packager or electron-forge, you might encounter the following error :

 An unhandled rejection has occurred inside Forge:
Error: /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/electron-packager/darwin-x64/electron-example-darwin-x64-5AYzr2/Electron.app/Contents/Resources/app/node_modules/macos-alias/build/node_gyp_bins/python3: file "../../../../../../../../../../../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11" links out of the package
This error is showing when trying to package an electron application for macOS with Electron Forge. It takes its root in electron-packager and is produced by node-gyp like described in this Github issue.

nodejs/node-gyp#2713
  • Loading branch information
obra committed Dec 18, 2023
1 parent 4d49994 commit c6bc8c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ let config = {
return packageJson;
},
packageAfterPrune: async (forgeConfig, buildPath, electronVersion, platform, arch) => {
if (platform === 'darwin') {
console.log("We need to remove the problematic link file on macOS")
console.log(`Build path ${buildPath}`)
fs.unlinkSync(path.join(buildPath, 'node_modules/macos-alias/build/node_gyp_bins/python3'))
},

const npmInstall = spawnSync("npm", ["install", "--omit=dev"], {
cwd: buildPath,
stdio: "inherit",
Expand Down

0 comments on commit c6bc8c6

Please sign in to comment.