I've previously tried the win_mouse
package, but it didn't work for me either, think it requires an older version of node.js.
One solution would be to use the ffi package, which allows you to dynamically load and call native libraries. To move the mouse on windows, you'd need to call the SetCursorPos
function from the user32.dll
like this:
var ffi = require("ffi");
var user32 = ffi.Library('user32', {
'SetCursorPos': [ 'long', ['long', 'long'] ]
// put other functions that you want to use from the library here, e.g., "GetCursorPos"
});
var result = user32.SetCursorPos(10, 10);
console.log(result);
Another solution would be to write a native node add-on that wraps around the SetCursorPos
function, but it is more complex.