-1

I have a problem with RobotJs i have an error :

"Uncaught Error: %1 nest pas une application Win32 valide.
  C:\Users\antoine\Desktop\testNW\node_modules\robotjs\build\Release\robotjs.node"

This problem happens with NodeWebKit. Howewer , when i run this script with node without NodeWebKit i haven't problem.

Example:

C:\Users\antoine\Desktop\testNW>node index.js
Mouse is at x:1281 y:132

file index.js

    var robot = require("robotjs");

    //Get the mouse position, returns an object with x and y. 
    var mouse = robot.getMousePos();
    console.log("Mouse is at x:" + mouse.x + " y:" + mouse.y);

    //Move the mouse down by 100 pixels.
    robot.moveMouse(mouse.x, mouse.y + 100);

    //Left click!
    robot.mouseClick();

Thank you in advance for your help,

1 Answers1

0

When using NW.js, native modules need to be compiled using nw-gyp. See this guide for more information:

https://github.com/nwjs/nw.js/wiki/Build-native-modules-with-nw-gyp

Jason Stallings
  • 1,443
  • 20
  • 17
  • Hi, I used nw-gyp but i found the problem. Apparently when i used the NW 64 bit version i have problem and with the 32 bit version no problem. – Antoine Drian Sep 28 '15 at 10:28