Robot/robot-js

robot-js binaries failed to install

Closed this issue · 21 comments

UPDATE:
If you're having the same problem, stop reading and just use this package instead.
https://github.com/octalmage/robotjs

npm i robot-js --save

> robot-js@1.0.2 install /Users/qashto/Documents/web/qodemate/node_modules/robot-js
> node Native/Install.js

ERROR: robot-js binaries failed to install. You will need to install them manually, see http://getrobot.net/docs/node.html for more info. Reason: bad response (404) Not Found

+ robot-js@1.0.2
updated 1 package in 3.619s

Trying to update robot-js because I just installed node v8.9.1. I get this error, how do I install the binaries manually?

I don't think this is related with node v8.9.1. as I've been able to install it on Windows 10 64bit.

E:\trash\robot-test>nvm use 8.9.1
Now using node v8.9.1 (64-bit)
E:\trash\robot-test>npm i robot-js --save
> robot-js@1.0.2 install E:\trash\robot-test\node_modules\robot-js
> node Native/Install.js

robot-test@1.0.0 E:\trash\robot-test
`-- robot-js@1.0.2

E:\trash\robot-test>node
> require('robot-js')
require('robot-js')
{ ADDON_VERSION: 65538,
  ADDON_VERSION_STR: '1.0.2',
  Hash: [Function: Hash],
  Color: { [Function: Color] normalize: [Function] },.....

We use the following variables to download a valid binary:

var SOURCE = "http://node.getrobot.net/addon/1.0.2/" +
	process.platform   + "-" +
	process.arch       + "-" +
	process.versions.modules +
	".node";

So it would be great if you can launch a node instance to log those values and paste them on this issue. Here are mine:

E:\trash\robot-test>node
> process.platform
process.platform
'win32'
> process.arch
'x64'
> process.versions.modules
'48'

Thanks for the quick reply and the clarification, I'm glad it's still working for node v8.9.1 on Windows 10. Here's what node outputs on my MacBook. Also I'm using LTS npm 5.5.1. I indeed get a 404 page not found if I try to use the url as described.

> process.platform
'darwin'
> process.arch
'x64'
> process.versions.modules
'57'

Ok, I have a Macbook Pro with node 8.9.1 and it also fails with the same error.

Well, you can build your own binary by cd'ing to node_modules/robot-js/Native then run $ make build and let's see if that works.

I want to use this package in an app that consumers will use though. I assume they won't be able to build witbout xcode or the command line tools installed. Are you a maintainer of this repository? Could you upload prebuilt binaries for 57? If they can be built without xcode could you make that addition to the install script so that it builds if the prebuilt binary install fails?

I'm a collaborator of this project. I propose you any of these solutions:

  • Use a supported node.js version like 8.0.x
  • Build the binaries for your consumers with $ make build and then distribute them on your own.
  • Wait until @dkrutsko releases new binaries that support that node.js version, however this will probably take some time.

As far I now there's nothing more we can do yet. 😯

We tried with two versions 6.8.1 and 8.9.1 on Windows as mentiond below :

process.versions
{ http_parser: '2.7.0',
node: '6.8.1',
v8: '5.1.281.84',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2j' }

process.versions
{ http_parser: '2.7.0',
node: '8.9.1',
v8: '6.1.534.47',
uv: '1.15.0',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.25.0',
openssl: '1.0.2m',
icu: '59.1',
unicode: '9.0',
cldr: '31.0.1',
tz: '2017b' }

but to our bad it didn't compile for us on windows with same error shared by @quinton-ashley

I have few queries :

  1. Did upgrading node version changes modules version too if yes then the node process versions should be diffrent from what you shared as per following link
    https://nodejs.org/en/download/releases/

  2. Get "http://node.getrobot.net/addon/1.0.2/win32-x64-48.node" request is getting timed out, I tried with https://www.hurl.it/

  3. How to compile it using Visual studio 2015 (as per the instructions provided at http://getrobot.net/docs/node.html#compiling) when we open Robot.sln file in Native folder using studio it says this type of sln file is not supported.

Kindly help us so that we should be able to compile it natively and create a package and distribute it.

Hi @srigaurav1986,

Directly downloading http://node.getrobot.net/addon/1.0.2/win32-x64-48.node works for me, don't trust thir party services like hurl.net as they may not perform HTTP requests like us.

You can download the same binaries from here: https://github.com/Robot/robot-js-binaries/tree/gh-pages/addon/1.0.2

Hi @karliky

Thanks for the response , I shall download them , just checking make build will work for Windows also ? I thought it was only for mac as its also a unix based system. I shall also try at my end and update.

My bad, you are right, @srigaurav1986, on windows you have to follow these steps:

    Download Robot and open the directory
    Open solution matching your VS version
    Build the project
    Run Test.exe if needed in Binaries/Win*

Did you open the vs solution for your version? If you encounter any error with Visual Studio please open a new issue .

No Issues and thanks for the quick response....I tried above mentioned steps for windows using Visual studio 2015 (as per the instructions provided at http://getrobot.net/docs/node.html#compiling) when we open Robot.sln file in Native folder using studio it says this type of sln file is not supported. I am not sure if we can do it in some other way possible.

Can you open a new issue to talk about your VS problem? https://github.com/Robot/robot-js/issues/new

I've been able to compile robot and tests with Visual Studio 2015 just now:
msbuild

For Robot-js you need the source code of Node.js and configure the VS solution to link agains it.

Sure, I shall and inform ticket number, but glad to see its working at your end.

Ok, make sure you have configured VS to link agains the source code of nodejs, there is a generic tutorial here about it https://www.youtube.com/watch?v=KvjHn59C-uQ

I think the main problem is that the current version of Robot doesn't use node-gyp as build system. @dkrutsko is working on this in a different branch which makes easier to compile the project, but if you really need this you have to setup visual studio correctly.

Also, I want to note that instead of trying to build your own binaries, it would be great if you can get them from the repo https://github.com/Robot/robot-js-binaries/tree/gh-pages/addon/1.0.2, you just have to make sure that you have the same node version, platform and versions.modules

Yeah I've been like... sidetracked, sorry :-(

However, the dev branch should have everything you need to compile the entire project easily through node-gyp, the same way you would any regular node addon. The API is also identical to master. I wanted to find some time to close two more issues but time has completely gotten away from me. I'm not sure if it'll work with Node 9 yet. I'll try it this weekend.

Ok, I'm gonna close this issue as binaries are available for our suported versions of Node.js. In case anyone wants to support a different Node.js/NPM version they can build their own binaries from master or dev with node-gyp.

Here you can find the installation instructions for any Node.js version:
http://getrobot.net/docs/node.html

Thank you all! 👍

Please don't close it, I am preparing data point to share my results.

I tried with node 6.8.1 with abi version 48 so that i can take prebuilt binaries shared but none of the supported electron build I can obtained. Electron 1.1.0 is sth which supports abi version 48 but it's not compatible with node 8.9.1 or 6.8.1. If i go with 1.6.8 electron abi version would be different, hence prebuild won't work if constant new releases of node and electron will come along with different abi versions and compatibility.So one way or the other it fails to build an executable. While using only node 6.8.1 require(robot-js') works well but creating a distribution is still farfetched.

Hence requesting some steps so that we can build our own rather than depending on prebuilt libraries.

Ok, I didn’t know you wanted to use electron with robot, you better read this #20 (comment)

The code you need is on the dev branch right now

I was confused about how to build the binaries, if anyone else is reading this all you have to do is clone robot-js into your project's node_modules folder, switch to the dev branch, cd into the folder, and then run npm install.

This issue will be fixed with the release of version 2.0.0.