1

我正在尝试在运行 Ubuntu 12.04 的 Beaglebone 上运行 Node Arduino 库 [https://github.com/rwldrn/johnny-5]。但是,当我尝试运行示例程序(servo.js 或任何其他程序)时,控制台会吐出:

/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/node_modules/bindings/bindings.js:91
  throw err
        ^
Error: Could not locate the bindings file. Tried:
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/out/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/out/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/default/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/compiled/0.8.15/linux/arm/serialport.node
    at bindings (/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/serialport.js:7:44)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/rov/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:9:18)
    at Module._compile (module.js:449:26)

我尝试通过 npm (npm install serialport) 安装串行端口,但仍然遇到相同的错误。如何安装 serialport 以便它可以被servo.js 文件识别?

4

1 回答 1

1

serialportjohnny-fiveand的依赖关系firmata,但由于firmata它本身是依赖关系,johnny-five我相信firmataserialport从 johnny-5/node_modules 引用。

另请注意,这serialport需要 Python 2.x

如果 npm 安装johnny-five正确,它应该已经将serialport.node 构建到johnny-five/node_modules/serialport/build/Release -你在那里看到了吗?

如果没有,请在新目录中尝试此操作

  • $ git clone https://github.com/rwldrn/johnny-five
  • $ cd johnny-five
  • $ npm install

它成功了吗?将/home/rov/node_modules/johnny-5替换为您刚刚构建的克隆存储库。

于 2013-07-02T07:45:00.090 回答