Search code examples
javascriptnode.jsjoystick

npm joystick problems with node js


I am trying to use a joystick with node js, and I ran into an issue.

I installed the function with

npm install joystick

that worked well, but when I ran this code to test it:

// Set a deadzone of +/-3500 (out of +/-32k) and a sensitivty of 350 
var joystick = new (require('joystick'))(0, 3500, 350);
joystick.on('button', console.log);
joystick.on('axis', console.log);

It gave me this error:

enter image description here

What am I doing wrong?

Thanks!!


Solution

  • I hate to write this as an answer, but it is. The package you reference, Joystick, has as its description: "Node.js module for reading joystick data under Linux"

    From your screenshot you are on Windows. The error you are getting is presumably it referencing IO which is giving you what is in effect a file no found message.