Anyone had luck using the npm module "raspi-io"?

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Anyone had luck using the npm module "raspi-io"?

Postby archman » Tue Mar 15, 2016 11:01 pm


I just started using arch arm to fix problems I was having building ffmpeg in raspbian. I'm using Node.js to listen to messages from a web interface, and acting on them by sending commands to the RPi's motors, and streaming back video from its camera onto the web page. The video streaming is working great now, but unfortunately the module I was using to control the motor board no longer works.

I tried Adafruit's python library for controlling the motors, but this incurs a delay because I have to make calls to a python shell from within JS. Has anyone else tried the "raspi-io" module for Node.js with any luck? When I install it, there aren't any notable errors, but when I try to run my server, it fails with the following error:
Code: Select all
    throw err;

Error: Cannot find module '../build/Release/addon'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/pi/workspace/robo-interface/node_modules/raspi/lib/index.js:30:29)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

When I check node_modules/raspi/build, which is presumably where it's trying to find that module, there is no such folder.

Anyway, I was hoping maybe someone else tried using this setup or something similar, and ran into problems they managed to fix. Please let me know.
Posts: 2
Joined: Tue Mar 15, 2016 1:08 am

Re: Anyone had luck using the npm module "raspi-io"?

Postby archman » Wed Mar 16, 2016 2:50 pm

Turns out it was a problem with NPM... it was installing all the raspi-io dependencies into the wrong folder. Running rm -rf node_modules in the project directory and redoing npm install solved it.
Posts: 2
Joined: Tue Mar 15, 2016 1:08 am

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 3 guests