【问题标题】:Unable to run bonescript files in Cloud9 on BeagleBone无法在 BeagleBone 上的 Cloud9 中运行骨骼脚本文件
【发布时间】:2012-05-08 15:32:44
【问题描述】:

我在使用 Cloud9 IDE 运行文件时遇到了问题,这些文件在预安装了 Angstrom Linux 版本的 BeagleBone 上使用了bonescript。我在 OSX 10.7 上的 Chrome 18 中使用 Cloud9 http://beaglebone.local:3000

当我运行Bonescriptblinkled.js 示例代码时,Cloud9 输出此错误:

Output
node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
       ^
Error: Cannot find module '/var/lib/cloud9'
    at Function._resolveFilename (module.js:326:11)
    at Function._load (module.js:271:25)
    at Array.<anonymous> (module.js:430:10)
    at EventEmitter._tickCallback (node.js:126:26)

如果我尝试按照in this StackOverflow question 的建议在运行配置中添加文件路径,我会在控制台中收到此错误(请注意红色):

[C9 Server Exception 2] undefined

此时 Cloud9 也停止响应,我必须重新加载页面以尝试进一步使用它。

如果我添加“blinkled.js”作为文件路径,我会收到此错误:

'inotify' not loaded
If desired, try installing it with:
  curl http://npmjs.org/install.sh | bash
  npm install inotify
'fibers' not loaded
If desired, try installing it with:
  curl http://npmjs.org/install.sh | bash
  npm install fibers
Delay operations loops will consume CPU cycles
Invoke using 'node-fibers' if node version < 0.5.2

不知道我应该放什么。

我已经用谷歌搜索这些各种错误大约 24 小时了。

这似乎是一个很棒的工具,如果我能让它工作的话。有什么想法吗?

更新 1

在意识到 opkg 未能加载所需的 inotify 和 fiber 包后,我手动安装了它们并再次尝试。现在我在命令行上得到这个错误:

# node blinkled.js 
gpio: 38 already exported.
{ [Error: EBUSY, resource busy or locked] errno: 10, code: 'EBUSY', syscall: 'write' }
Unable to export gpio: 56

【问题讨论】:

    标签: node.js beagleboard cloud9-ide


    【解决方案1】:

    现在我意识到存在多个问题:

    首先,我应该检查文档以使 node.js 工作。当我应该使用 console.log() 时,我只是假设 alert() 是一个函数。所以一旦我意识到这一点,我就可以在 Cloud9 中运行这个文件:

    var hello = "hello world"
    console.log(hello);
    

    其次,当我尝试使用 npm 包管理器安装库(inotify 和 Fiber)时,它会将它们放在我工作目录的 node_modules 目录中:

    /home/root/
    

    ...不是我认为的默认 Cloud9 根目录:

    /var/lib/cloud9
    

    第三,我的 pin 已经导出,只需重启 BeagleBone 即可解决。

    最后,我发现在我的主目录中使用最新版本的 bonescript 创建一个新实例允许我运行 blinkled.js 示例文件,以及来自命令行。

    【讨论】:

      【解决方案2】:

      您可以在 /var/lib/cloud9 中执行“git pull”来获取更新。我添加的一件事是“analogRead”功能。

      【讨论】:

        【解决方案3】:

        我是小猎犬骨转速。 A4。这种错误也正在发生。 我刚刚用最新的埃图像制作了新的 SD 卡,然后在闪烁后正常工作。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-06
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-10-19
          • 2019-03-12
          • 1970-01-01
          • 2016-08-14
          相关资源
          最近更新 更多