GithubHelp home page GithubHelp logo

install fails on ubuntu about robotjs HOT 34 CLOSED

octalmage avatar octalmage commented on June 25, 2024 7
install fails on ubuntu

from robotjs.

Comments (34)

octalmage avatar octalmage commented on June 25, 2024

So far I've only tested RobotJS on Mac, although technically the code is cross platform. The build script probably needs to be modified.

You we're able to get it installed? What part doesn't work? Do you get any errors?

Thanks!

from robotjs.

amih avatar amih commented on June 25, 2024

After installing the xorg-dev I successfully installed the robotjs but following the demo resulted in error messages:

> var robot = require("robotjs");
undefined
> var mouse=robot.getMousePos();
node: symbol lookup error: /home/amih3/tmp/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: XGetMainDisplay

I hope this helps, thank you!

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Could you try installing ibxtst-dev?

sudo apt-get install ibxtst-dev

I believe this should resolve the issue.

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

Ah, you mean libxtst-dev (I assume). Still doesn't work but I'm having a look at the build script and seeing if I can work it out :)

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

@amih, @DamonOehlman was able to get RobotJS building for Linux and I merged his pull request. Could you try the latest code to see if it works?

@DamonOehlman were there any additional packages needed?

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

Nope, xorg-dev was all that was required and I suspect we can get it down to a tighter list also, but I haven't investigated that as yet...

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Awesome!

So libxtst-dev wasn't needed after all?

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

I think it was, but was brought in as a dependency of xorg-dev. Let me uninstall xorg-dev and I'll try and identify the specific packages that are required.

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

OK, I looks like libxtst-dev is the best package to require as a dependency as bringing it in also brings in libx11-dev which is also required. I did however also specify png and z as required link settings as these were expressed as dependencies in autopy.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Great, thanks again for your help. I'll get the readme updated and a new version out tonight. z and png may not be needed now, but they will be necessary dependencies as soon as I finish the screen and bitmap modules.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

I'll confirm in a VM and close this out also.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Now I can start with continual integration and unit testing. I'm excited.

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

Nice. Note some changes for travis around the new docker containers around installing APT packages but yeah this should be pretty easy to test there :)

from robotjs.

ValerieDittmar avatar ValerieDittmar commented on June 25, 2024

I tried building it on my machine under Ubuntu 14.10 and I ran into a dependency issue with a few items:

One was installing npm install nan for node-gyp.

The other dependency I ran across was a libgd-dev error on node-gyp build which prompted:/usr/bin/ld: cannot find -lpng.

sudo apt-get install libgd-dev resolved the /usr/bin/ld: cannot find -lpng message.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

In testing with @JohnDittmar we found that some functions don't work on Ubuntu, like keyTap and getPixelColor. These need to be working before I update the readme and close this.

from robotjs.

DamonOehlman avatar DamonOehlman commented on June 25, 2024

Sure thing - if I get some more time I'll investigate and see if I can work out what's required.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Same here! I believe one issue is the snprintf function in getPixelColor.

from robotjs.

smmoosavi avatar smmoosavi commented on June 25, 2024

Is there any solution for node: symbol lookup error: /home/amih3/tmp/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: XGetMainDisplay?

System info:

node v0.12.0
Ubuntu 12.04.1 

Also problem exist for other functions

getMousePos => XGetMainDisplay
typeString => XStringToKeysym
getPixelColor => XOpenDisplay

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

The Linux build still needs a lot of work, unfortunately I don't know a solution currently. probably missing includes or compiler flags.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Actually, did you try the code in this repository? Or just install using NPM?

from robotjs.

smmoosavi avatar smmoosavi commented on June 25, 2024

Yesterday I use npm i robotjs.
Now npm i git+https://[email protected]/octalmage/robotjs.git fixed problem. getMousePos and typeString work correctly.
but new buffer overflow problem occurred with getPixelColor explained in #19

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Great! I have an idea about getPixelColor, unfortunately it's not convenient for me to work on Linux.

from robotjs.

douglas-larocca avatar douglas-larocca commented on June 25, 2024

For anyone who may have the same issue on debian, X11/extensions/XTest.h is provided by libxtst-dev.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Could someone let me know if this code works with RobotJS from the master branch?

var robot = require("robotjs");

//Press space. 
robot.keyTap("space");

I just added space to keyTap, but I'm unsure if I got the Linux keycode right. See: 523cf3b.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Nevermind! I used my VM to test, and I was wrong. I fixed it in e935825 though.

Finally found the correct keycode in this code:
https://gitlab.com/higan/higan/blob/3ce1d19f7a6890b410f1687ea88759b3aff6a367/ruby/input/keyboard/xlib.cpp#L283

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Ok I fixed the issue with gePixelColor #19, but the returned colors seem off.

Could someone double check this?

Thanks!

Edit: I just ran some tests using Ubuntu and every other function works fine. getPixelColor is the last issue, if there is an issue.

from robotjs.

smmoosavi avatar smmoosavi commented on June 25, 2024

I test it on ubuntu. it works.

$ node index.js  # readme example output.
#c80003 at x:1007 y:474

my os:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

@smmoosavi Awesome! Does the hex match the screen?

from robotjs.

smmoosavi avatar smmoosavi commented on June 25, 2024

yes, mouse is on red color when I run js file.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Great! Then it looks like we have full Linux support. I'll close this in a few days, just want to confirm everything is working as expected.

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

I've done some additional testing and I'm going to consider this closed!

from robotjs.

gasolin avatar gasolin commented on June 25, 2024

should add a comment in README to help user setup build environment on ubuntu,

sudo apt-get install libxtst-dev libpng++-dev

from robotjs.

octalmage avatar octalmage commented on June 25, 2024

Yeah for sure, Windows and Mac need instructions also. I'll work on this today.

from robotjs.

johnmarlow007 avatar johnmarlow007 commented on June 25, 2024

Hi octalmage,
First of all, GREAT PROJECT! I tested it on a windows machine and it works like a charm, but now I am trying to install it on an Ubuntu (zorin) laptop and I got a few error and I got stuck on one.
The last one is:

Error: /home/a/test/robotjs/node_modules/robotjs/build/Release/robotjs.node: undefined symbol: YTestFakeButtonEvent
at Error (native)
at Object.Module._extensions..node (module.js:435:18)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/a/test/robotjs/node_modules/robotjs/index.js:1:77)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)

Any idea what can it be?
Sorry if its a stupid one, I am not using linux too much...
Thanks a lot for your efforts!
I am trying to support this project as much as I can.

from robotjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.