Open Suhail opened 5 years ago
Update:
When I got rid of the || since powershell doesn't support that and just tried to npm install locally. Effectively, it's now running node-gyp rebuild
since there's no pre-built I imagine for Node 12.x.
Building in VS17 went fine & succeeded.
I began to get these errors as well:
[Compiling...]
NodeRobot.cc
NodeImage.cc
NodeKeyboard.cc
NodeMouse.cc
NodeProcess.cc
NodeMemory.cc
NodeWindow.cc
NodeScreen.cc
c:\users\digit\desktop\workspace\proj\node_modules\robot-js\src\nodeimage.cc(112): error C2661: 'v8::Function::NewInstance': no overloaded function takes 2 arguments [C:\Users\digit\Desktop\workspace\cl
oudbox\node_modules\robot-js\build\win32-x64-67.vcxproj]
c:\users\digit\desktop\workspace\proj\node_modules\robot-js\src\nodeimage.cc(204): error C2661: 'v8::Function::NewInstance': no overloaded function takes 2 arguments [C:\Users\digit\Desktop\workspace\cl
oudbox\node_modules\robot-js\build\win32-x64-67.vcxproj]
c:\users\digit\desktop\workspace\proj\node_modules\robot-js\src\nodeimage.cc(209): error C3536: 's': cannot be used before it is initialized [C:\Users\digit\Desktop\workspace\proj\node_modules\robot
-js\build\win32-x64-67.vcxproj]
c:\users\digit\desktop\workspace\proj\node_modules\robot-js\src\nodeimage.cc(221): error C2661: 'v8::Function::NewInstance': no overloaded function takes 2 arguments [C:\Users\digit\Desktop\workspace\cl
oudbox\node_modules\robot-js\build\win32-x64-67.vcxproj]
It seems related to my node version. I want to compile it to use Node 12.x. I noticed the docs are outdated and mentioned some UserMacro -> NodeVersion I could change but I couldn't find that anywhere.
Node 12 has some changes in the ABI, which were breaking builds. I've opened a #74 with some fixes which ought to get node-gyp working again. Alternately, you can run from my prebuilt fork by specifying "robot-js": "github:p120ph37/robot-js#prebuilt"
in your package.json
.
I use with Node 10, still get the same error.
EDIT: Where should I put fork in package.json?
@kkm Put it inside the dependencies and replace it with the robot-js module. Node 12 is still not supported, we have to merge a PR into master and release the prebuilt binaries. Let's see if @dkrutsko can do it soon 😄
This works as of 7/27/2020
// package.json
{
"name": "robot-js-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"robot-js": "github:p120ph37/robot-js#prebuilt"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Used yarn install after adding "robot-js": "github:p120ph37/robot-js#prebuilt" to the dependencies.
// index.js
// Node
var robot = require ("robot-js");
// Must be true in order to work
if (robot.Window.isAxEnabled()) {
var list = robot.Window.getList (".*");
// List is an array
list.forEach((w) => {
console.log(w.getTitle())
; // Always contains "title"
});
}
Yeah, I updated my fork and prebuilt binaries a couple weeks ago. Should work up to Node 14 and Electron 9. I'm waiting for Electron 10 to come out of beta before adding it to the prebuilt list, but so far it looks like it ought to be possible without any additional tweaks to the source.
I ran this:
Error:
Env