-
Notifications
You must be signed in to change notification settings - Fork 963
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
robot.js wont work with Electron #466
Comments
Did you follow the electron installation instruction ? https://github.com/octalmage/robotjs/wiki/Electron
|
Still can't get this to work. |
I also encountered this problem.How do you solve this problem? |
Bump? |
|
Same here, I can't get it to compile. Please help. |
yeh i have the same problem with electron rebuild |
I ended up using xdotool instead, just launching it as a child process, if
anyone needed an alternative for now.
…On Thu, Aug 15, 2019, 2:55 AM Yomi Adenaike ***@***.***> wrote:
yeh i have the same problem with electron rebuild
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#466?email_source=notifications&email_token=AA6OUC46ZY37V5NWHPHGX7TQEUKWLA5CNFSM4G7AWDE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4LH27A#issuecomment-521567612>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6OUC43I2GAPV6DMGY6AUDQEUKWLANCNFSM4G7AWDEQ>
.
|
Can that get the color of a pixel from the screen because that's all I need |
It looks like it does not, just keyboard and mouse controls. One option that comes up in google is using xdotool with grabc which gets the pixel color under the mouse when the screen is clicked. Or you could probably take a screenshot with something and then use something else to get the pixel color at a location in the image. By drawing it to a canvas and then getting the color of a pixel for example, or finding a command line tool that can do it. edit: assuming you're using linux. I'm not sure what windows tools you'd need to use. Feels weird recommending the use of something else in a project's github, but my first instinct was "ok damn let's try just using an old version of electron that will work with it" since I don't understand compiling errors. And I couldn't really get that to work either so then I realized duh just use a system alternative. So maybe it's helpful advice for other noobs like me. |
Which node modules folder? The one in the electron-rebuild module, or the one in the project folder? |
The version we get from npm (0.5.1) just won't work as is. It has been released using apis that are now deprecated/deleted, or at least that is what I see in my console output when running rebuild. This should have been fixed with this commit but no new version has been pushed to npm since then. |
a new version of robotjs supporting the latest NodeJS version will be published soon. |
Try rebuilding robotjs with electron-rebuild: Step 1: Step 2:
If you can get these commands to run without error in your project root (next to your root package.json), it should build you a version of robotjs that works with your Electron. Note that this won't get you all binaries for all platforms, only the platform on which you run the command. If you're using a version of node+npm that doesn't have npx, or have some other problem, try reading the instructions for alternate ways of running electron-rebuild here: https://github.com/electron/electron-rebuild Note 1: Alternate invocation: Note 2: This has not been tested with ABI > 72, meaning versions of Electron that contain Node v13+. AFAIK there is no stable release of Electron using Node v13+ though. |
We are waiting please release soon it's causing a lot of problem in electron |
This new version has been published (0.6.0) but there is an error in the latest NodeJS version |
@mike-clark-8192 - worked perfectly for me, thanks! :)
|
Thanks, this worked. the |
This worked for me:
versions: |
@ya3ya6 worked for me too! thanks! |
Now what? Didn't work for me, I installed Visual Studio with everything required yet it did not work for some reason. Any alternate way? |
@Jaagrav |
I already installed and figured out the problem. To those who are reading this, ignore the shit I wrote above, here's what worked for me on the first try. In the docs, it clearly mentions this command to rebuild and compile robotjs and electronjs to the same version,
What I believe most people are doing wrong, perhaps the reason why this wasn't working for you as well is the So I ran
and the version was way ahead, I wonder why it wasn't working before. And immediately, literally immediately after I changed and executed this command,
Just like literal magic, it worked, in the first try! I spent so long trying to figure this out and the culprit was sitting right in front of my eyes! THAT'S IT! |
@Jaagrav you're right you can usually get it working that way if you can figure out your nodejs version, electron version, and ABI version. But why go through the trouble when the electron-rebuild tool is available specifically to make this exact problem easier? Also electron-rebuild can help compile other types of native projects where the exact arguments to rebuild are less clear. It's just a better approach, IMO.
|
@wikked1 im having similar issue, electron-rebuild build successful node_modules\robotjs\build\Release\robotjs.node but when i try to use it in the electron i get an error:
any idea what could be? "electron": "12.0.6", |
I am facing this kind of error. What should I do? |
I CAN'T BELIEVE I HAVE BEEN 2 DAYS STUCK WITH THIS AND CAN'T YET MAKE IT WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORK |
Expected Behavior
App runs and starts logging mouse position
Current Behavior
App doesnt run and spits out this error:
Possible Solution
Steps to Reproduce (for bugs)
I cant include much code (private), but here goes:
Context
I need to grab the current mouse position to fire a bullet towards it.
Your Environment
The text was updated successfully, but these errors were encountered: