Open DoneDeal0 opened 1 year ago
@DoneDeal0 Sorry for the delayed response. Do you have an exact repro available? This seems like an issue with the native module you're using but I'd like to confirm the setup on my end as well.
@erickzhao here is a basic repo: https://github.com/DoneDeal0/electron-build-fail
If I remove it, the build works fine. Unfortunately, I need this lib.
I have node 18.16.1
. The build fails on a machine with an I7 chip, but works fine on an M2 machine. This is very strange. The PDFJS team won't help me because I use their lib in Electron.
@erickzhao hi, have you had time to research this issue?
i have a Similar question
electron-forge make
✔ Checking your system rget/fse/fsevents.o In file included from ../fsevents.cc:6: ../../../../nan/nan.h:688:39: warning: 'IdleNotificationDeadline' is deprecated: Use… return v8::Isolate::GetCurrent()->IdleNotificationDeadline( ^ /Users/tangsong/.electron-gyp/28.1.4/include/node/v8-isolate.h:1343:3: note: 'IdleNo… V8_DEPRECATE_SOON( ^ /Users/tangsong/.electron-gyp/28.1.4/include/node/v8config.h:561:41: note: expanded …
^ ../fsevents.cc:14:10: fatal error: 'src/storage.cc' file not found
^~~~
1 warning and 1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
Error: make
failed with exit code: 2
at ChildProcess.onExit (/Users/tangsong/Documents/cqq/test/demo/node_modules/node-gy…
at ChildProcess.emit (node:events:513:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild '/private/var/folders/6c/44_3vj9n74sdtr04s4nndkr40000gp/T/electron-packager/tmp-JTs2GE/Electron.app/Contents/Resources/app/node_modules/watchpack-chokidar2/node_modules/fsevents'
at ChildProcess.
Same problem for me when I installed ssh2 in my electron forge project. Node-gyp can not rebuild cpu-features which is one of the dependencies of ssh2. The environment info is: cpu: M1 Pro os: MacOS 14.3.1 node: v18.18.0 electron: ^29.0.1 electron-forge: ^7.3.0 ssh2: ^1.15.0
Same problem for me when I installed ssh2 in my electron forge project. Node-gyp can not rebuild cpu-features which is one of the dependencies of ssh2. The environment info is: cpu: M1 Pro os: MacOS 14.3.1 node: v18.18.0 electron: ^29.0.1 electron-forge: ^7.3.0 ssh2: ^1.15.0
For this problem, I found ssh2-electron-no-cpu-features which do not need cpu-features
dependency. And this worked for me. If you using typescript, you can just install @types/ssh2
and rename node_modules/@types/ssh2 to ssh2-electron-no-cpu-features, then you can have fully annotations. Wish this can help you if you have same problem.
1) Open your lock file
2) Find the ssh2's dependencies, you can see the cpu-features
is optional, just drop this dependency from there.
my case looks like:
"ssh2@npm:^1.5.0":
version: 1.5.0
resolution: "ssh2@npm:1.5.0"
dependencies:
asn1: ^0.2.4
bcrypt-pbkdf: ^1.0.2
- cpu-features: 0.0.2
- nan: ^2.15.0
dependenciesMeta:
cpu-features:
optional: true
nan:
optional: true
...
3) reinstall deps
Pre-flight checklist
Electron Forge version
6.2.1
Electron version
25.2.0
Operating system
macOS 13.4.1
Last known working Electron Forge version
No response
Expected behavior
The app should compile.
Actual behavior
The electron app doesn't compile properly. Here is the complete log:
Steps to reproduce
I have the latest version of Electron and associated lib. The app works fine on macOS Big Sure, but not on macOS Ventura.
Do I need to globally install a package like
node-gyp
to make it work?Additional information
No response