max-mapper / screencat

:cat2: webrtc screensharing electron app for mac os (Alpha)
http://maxogden.github.io/screencat
BSD 2-Clause "Simplified" License
3.02k stars 383 forks source link

Robotjs failed to load in MacOSX #57

Closed humanely closed 7 years ago

humanely commented 7 years ago

Hi,

This gives error to load robotjs in mac. Has anyone faced this issue?

[Error: ./robot.js failed to load] [Error: Module version mismatch. Expected 47, got 48.]

msakrejda commented 7 years ago

I've seen this in other projects, generally when switching node versions without rebuilding native modules (but sometimes in other situations). Running rm -rf node_modules && npm install has always fixed it for me.

humanely commented 7 years ago

Tried that. But problem still exists. Also, as mentioned in Robotjs here but no help.

humanely commented 7 years ago

After some trials and cache cleanups, I am getting:

[Error: ./robot.js failed to load] [Error: Module version mismatch. Expected 47, got 51.]

mafintosh commented 7 years ago

you need to build it against electron after installing, npm run rebuild, https://github.com/maxogden/screencat/blob/master/package.json#L11

humanely commented 7 years ago

At last! This solved my issue. http://electron.atom.io/docs/tutorial/using-native-node-modules/ ./node_modules/.bin/electron-rebuild