Open Viiprogrammer opened 3 years ago
Others and me had the same problem and this helped: https://github.com/octalmage/robotjs/issues/466#issuecomment-590491327
Would be cool though if they fixed the underlying problem, so that we don't have to recompile. (But maybe the problem is on electrons side)
npm rebuild --runtime=electron --target=9.0.2 --disturl=https://atom.io/download/atom-shell --abi=72
Use electron-builder and add in your package.json
scripts section:
"postinstall": "electron-builder install-app-deps"
Each time you run yarn it will re-compile to the electron version you have installed.
it is because all native node modules need a rebuild for electron as described here: https://www.electronjs.org/docs/tutorial/using-native-node-modules
Not only robojs, when I use node-pty, I got this error. The problem was resolved by using electron-rebuild:
scripts: {
"rebuild-node-pty": "electron-rebuild -f -w node-pty"
}
run this command manually:
npm run rebuild-node-pty
same as node-pty:
scripts: {
"rebuild-robojs": "electron-rebuild -f -w robojs"
}
I found another way to solve this I found a fork of robotjs, and I use this library to replace robotjs, https://github.com/hurdlegroup/robotjs
If i runing electon app with RobotJS, throw error:
I try to run
npm rebuild --runtime=electron --target=11.2.3 --disturl=https://atom.io/download/atom-shell --abi=72
and rebuilding successfuly, but dosen't work.Environment