Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
willpakpoy opened this issue May 20, 2024 · 11 comments
Open
3 tasks done

Comments

@willpakpoy
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

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

@willpakpoy willpakpoy changed the title Running electron-forge make fails with no message at 'Preparing native dependencies' stage Running electron-forge make fails with no message at 'Preparing native dependencies' stage May 20, 2024
@gorillamoe
Copy link

gorillamoe commented May 20, 2024

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

DEBUG=electron-packager electron-forge make

@willpakpoy
Copy link
Author

willpakpoy commented May 20, 2024 via email

@gorillamoe
Copy link

Seems like you did not install the dev dep with npm i -D @electron-forge/[email protected], did you?

@willpakpoy
Copy link
Author

willpakpoy commented May 20, 2024 via email

@gorillamoe
Copy link

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

@willpakpoy
Copy link
Author

@gorillamoe
Copy link

gorillamoe commented May 21, 2024

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
Copy link
Author

CleanShot 2024-05-22 at 00 41 51

Just tried that. Unfortunately it still failed to build.

@gorillamoe
Copy link

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

@willpakpoy
Copy link
Author

willpakpoy commented May 21, 2024 via email

@Enivel
Copy link

Enivel commented Jun 5, 2024

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

[email protected] 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'
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants