electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.33k stars 492 forks source link

Running ```electron-forge make``` fails with no message at 'Preparing native dependencies' stage #3603

Open willpakpoy opened 1 month ago

willpakpoy commented 1 month ago

Pre-flight checklist

Electron Forge version

7.4.0

Electron version

v30.0.6

Operating system

macOS Sonoma 14.2 (build 23C5030f)

Last known working Electron Forge version

N/a.

Expected behavior

When running electron-forge make, the application should build.

Actual behavior

The electron app fails to build at the "Preparing native dependencies" stage. There is no output.

CleanShot 2024-05-20 at 18 34 41

Steps to reproduce

This is my electron entrypoint file. I just started working on this project so there isn't much here right now.

import { app, BrowserWindow } from 'electron'

let mainWindow
app.whenReady().then(() => {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 600
  })
  mainWindow.loadURL('http://localhost:5173')
})

Additional information

No response

gorillamoe commented 1 month ago

Can you run the following command and put the output here?

DEBUG=electron-packager electron-forge make
willpakpoy commented 1 month ago

electron-forge make

✔ Checking your system ❯ Loading configuration ✔ Loading configuration ❯ Resolving make targets › Making for the following targets: ✔ Resolving make targets ❯ Running package command ❯ Preparing to package application ✔ Preparing to package application ❯ Running packaging hooks ❯ Running generateAssets hook ✔ Running generateAssets hook ❯ Running prePackage hook ✔ Running prePackage hook ✔ Running packaging hooks ❯ Packaging application › Determining targets... electron-packager Electron Packager 18.3.2 electron-packager Node v21.5.0 electron-packager Host Operating system: darwin 23.2.0 (arm64) +0ms electron-packager Packager Options: {"asar":false,"overwrite":true,"ignore":[{}],"quiet":true,"dir":"/Users/will/projects/Anthem","arch":"arm64","platform":"darwin","afterFinalizePackageTargets":[null],"afterComplete":[null],"afterCopy":[null],"afterExtract":[null],"afterPrune":[null],"out":"/Users/will/projects/Anthem/out","electronVersion":"30.0.6"} +0ms electron-packager Target Platforms: darwin +0ms electron-packager Target Architectures: arm64 +0ms electron-packager Inferring application name from productName in /Users/will/projects/Anthem/package.json +2ms electron-packager Inferring appVersion from version in /Users/will/projects/Anthem/package.json +0ms electron-packager Application name: Edparo +0ms electron-packager Target Electron version: 30.0.6 +0ms electron-packager Ignored path regular expressions: [ /^\/out\//g, '/package-lock\.json$', '/yarn\.lock$', '/\.git($|/)', '/node_modules/\.bin($|/)', '\.o(bj)?$', '/node_gyp_bins($|/)' ] +0ms ❯ Packaging for arm64 on darwin ❯ Copying files ❯ Preparing native dependencies ❯ Finalizing package (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (Use node --trace-deprecation ... to show where the warning was created) electron-packager Downloading Electron with options {"platform":"darwin","arch":"arm64","version":"30.0.6","artifactName":"electron"} +4ms electron-packager Creating /var/folders/0j/h79qgyjn0455cn39vp7p5l7h0000gp/T/electron-packager/darwin-arm64-template-e3qqxI +106ms electron-packager Extracting /Users/will/Library/Caches/electron/3d54a9c718fab1884964396a513941a6e35990df5e2be68ec213b09987fb5e2b/electron-v30.0.6-darwin-arm64.zip to /var/folders/0j/h79qgyjn0455cn39vp7p5l7h0000gp/T/electron-packager/darwin-arm64-template-e3qqxI +0ms electron-packager Initializing app in /var/folders/0j/h79qgyjn0455cn39vp7p5l7h0000gp/T/electron-packager/tmp-Rrz0XO from /var/folders/0j/h79qgyjn0455cn39vp7p5l7h0000gp/T/electron-packager/darwin-arm64-template-e3qqxI template +1s (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. electron-packager Ignored paths based on the out param: [ '/Users/will/projects/Anthem/out' ] +3ms ✔ Copying files (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:41671) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.

An unhandled rejection has occurred inside Forge: Error: ENOENT: no such file or directory, stat @.***/maker-dmg'

On 20 May 2024, at 10:21 pm, Marco Kellershoff @.***> wrote:

Can you run the following command and put the output here?

DEBUG=electron-packager npm run make — Reply to this email directly, view it on GitHub https://github.com/electron/forge/issues/3603#issuecomment-2120351155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLFER2L2X32D4QB4BBOKXLZDHTDXAVCNFSM6AAAAABH7JLEZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGM2TCMJVGU. You are receiving this because you authored the thread.

gorillamoe commented 1 month ago

Seems like you did not install the dev dep with npm i -D @electron-forge/maker-dmg@7.4.0, did you?

willpakpoy commented 1 month ago

CleanShot 2024-05-20 at 23 49 58

I’ve just reinstalled it to check. Didn’t have it in the dev dependencies before, but it was still there.

On 20 May 2024, at 11:42 pm, Marco Kellershoff @.***> wrote:

Seems like you did not install the dev dep with npm i -D @@.***, did you?

— Reply to this email directly, view it on GitHub https://github.com/electron/forge/issues/3603#issuecomment-2120490414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLFER4KTKW25LUTY6I557DZDH4WHAVCNFSM6AAAAABH7JLEZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGQ4TANBRGQ. You are receiving this because you authored the thread.

gorillamoe commented 1 month ago

Can you, by any chance, put a repro example up as a public repo, so we can dig into this?

willpakpoy commented 1 month ago

@gorillamoe, just set one up: https://github.com/willpakpoy/ElectronForgeExampleRepo

gorillamoe commented 1 month ago

It did build with the following changes (at least under linux):

image

Can you try to add the executableName: "Anthem" inside forge.config.js (inside the packagerConfig key) and try to build again?

You can neglect the changes to the makers section, because they are just for the linux build..

willpakpoy commented 1 month ago

CleanShot 2024-05-22 at 00 41 51

Just tried that. Unfortunately it still failed to build.

gorillamoe commented 1 month ago

Your error log states that cross-zip is missing, can you install it (npm i -D cross-zip) and try again?

willpakpoy commented 1 month ago

I had cross-zip installed as a normal depedency, I just moved it to be a dev dependency and it still isn’t working.

On 22 May 2024, at 12:48 am, Marco Kellershoff @.***> wrote:

Your error log states that cross-zip is missing, can you install it (npm i -D cross-zip) and try again?

— Reply to this email directly, view it on GitHub https://github.com/electron/forge/issues/3603#issuecomment-2122810109, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLFERYXWELBF6INSO6FO7DZDNNDJAVCNFSM6AAAAABH7JLEZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSHAYTAMJQHE. You are receiving this because you authored the thread.

Enivel commented 4 weeks ago

Same mistake, this is a brand new project installed through npm init electron-app@latest my-app -- --template=vite-typescript without any adjustments, on macOS Apple chip.

`DEBUG=electron-packager npm run make

realtest2@1.0.0 make electron-forge make --platform darwin

✔ Checking your system ❯ Loading configuration 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. ✔ Loading configuration ❯ Resolving make targets › Making for the following targets: ✔ Resolving make targets ❯ Running package command ❯ Preparing to package application ✔ Preparing to package application ❯ Running packaging hooks ❯ Running generateAssets hook ✔ Running generateAssets hook ❯ Running prePackage hook ❯ [plugin-vite] Building vite bundles vite v5.2.12 building for production... vite v5.2.12 building for production... vite v5.2.12 building for production... ✓ 1 modules transformed. Generated an empty chunk: "preload". ✓ 1 modules transformed. .vite/build/preload.js 0.01 kB │ gzip: 0.03 kB ✓ built in 38ms .vite/build/main.js 0.50 kB │ gzip: 0.32 kB ✓ built in 39ms ✓ 4 modules transformed. .vite/renderer/main_window/index.html 0.37 kB │ gzip: 0.26 kB .vite/renderer/main_window/assets/index-CKttBNm8.css 0.14 kB │ gzip: 0.14 kB .vite/renderer/main_window/assets/index-D8Tcqwow.js 0.79 kB │ gzip: 0.46 kB ✓ built in 50ms ✔ [plugin-vite] Building vite bundles ✔ Running prePackage hook ✔ Running packaging hooks ❯ Packaging application › Determining targets... electron-packager Electron Packager 18.3.2 electron-packager Node v22.2.0 electron-packager Host Operating system: darwin 23.5.0 (arm64) +0ms electron-packager Packager Options: {"asar":true,"overwrite":true,"quiet":true,"dir":"/Users/levine/workspace/kepo-projects/realtest2","arch":"arm64","platform":"darwin","afterFinalizePackageTargets":[null],"afterComplete":[null],"afterCopy":[null],"afterExtract":[null],"afterPrune":[null],"out":"/Users/levine/workspace/kepo-projects/realtest2/out","electronVersion":"30.0.9"} +0ms electron-packager Target Platforms: darwin +0ms electron-packager Target Architectures: arm64 +0ms electron-packager Inferring application name from productName in /Users/levine/workspace/kepo-projects/realtest2/package.json +2ms electron-packager Inferring appVersion from version in /Users/levine/workspace/kepo-projects/realtest2/package.json +0ms electron-packager Application name: realtest2 +0ms electron-packager Target Electron version: 30.0.9 +0ms ❯ Packaging for arm64 on darwin ❯ Copying files ❯ Preparing native dependencies ❯ Finalizing package (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (Use node --trace-deprecation ... to show where the warning was created) electron-packager Downloading Electron with options {"platform":"darwin","arch":"arm64","version":"30.0.9","artifactName":"electron"} +42ms electron-packager Creating /var/folders/qv/t41zh7gs1k918lhtlg86blcr0000gp/T/electron-packager/darwin-arm64-template-9Zhlgx +115ms electron-packager Extracting /Users/levine/Library/Caches/electron/f1a3e5f647b34f2b060d31fed347d8b7e4415c443f628b53d0a125d8cd235da4/electron-v30.0.9-darwin-arm64.zip to /var/folders/qv/t41zh7gs1k918lhtlg86blcr0000gp/T/electron-packager/darwin-arm64-template-9Zhlgx +0ms electron-packager Initializing app in /var/folders/qv/t41zh7gs1k918lhtlg86blcr0000gp/T/electron-packager/tmp-3Nc5uS from /var/folders/qv/t41zh7gs1k918lhtlg86blcr0000gp/T/electron-packager/darwin-arm64-template-9Zhlgx template +945ms (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. electron-packager Ignored paths based on the out param: [ '/Users/levine/workspace/kepo-projects/realtest2/out' ] +1ms ✔ Copying files (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. (node:79978) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.

An unhandled rejection has occurred inside Forge: Error: ENOENT: no such file or directory, stat '/private/var/folders/qv/t41zh7gs1k918lhtlg86blcr0000gp/T/electron-packager/tmp-3Nc5uS/Electron.app/Contents/Resources/app/node_modules/electron-squirrel-startup' `