无法在BeagleBone上的Cloud9中运行骨骼脚本文件 [英] Unable to run bonescript files in Cloud9 on BeagleBone

查看:106
本文介绍了无法在BeagleBone上的Cloud9中运行骨骼脚本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用Cloud9 IDE在预安装版本Angstrom Linux的BeagleBone上运行使用骨骼脚本的文件。我在OSX 10.7的Chrome 18中的 http://beaglebone.local:3000 上使用Cloud9。

I am having trouble using the Cloud9 IDE to run files which use bonescript on a BeagleBone with the pre-installed version of Angstrom Linux. I am using Cloud9 at http://beaglebone.local:3000 in Chrome 18 on OSX 10.7.

当我运行 Bonescript blinkled.js示例代码时Cloud9输出以下错误:

When I run the Bonescript blinkled.js sample code Cloud9 outputs this error:

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)

如果我尝试按照建议的方式在运行配置中添加文件路径在这个StackOverflow问题中,我在控制台中收到此错误(以红色提醒您):

If I try adding a file path in the run configuration as suggested in this StackOverflow question I get this error in the Console (in bright red mind you):

[C9 Server Exception 2] undefined

这时Cloud9也停止响应,我必须重新加载页面才能尝试

At this point Cloud9 also stops responding and I have to reload the page to attempt to use it further.

如果我将 blinkled.js添加为文件路径,则会出现此错误:

If I add "blinkled.js" as the file path I get this error:

'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小时。

I've been Googling these various errors for about 24 hours now.

如果我只能让它正常工作,这似乎是一个很棒的工具。有任何想法吗?

This seems like a great tool, if I can only get it to work. Any ideas?

更新1

在意识到opkg加载失败后所需的inotify和fiber软件包,我手动安装了它们,然后重试。现在,我在命令行上收到此错误:

After realizing the opkg had failed to load the required inotify and fibers packages I installed them manually and tried again. Now I get this error on the command line:

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


推荐答案

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

Now I realize there were multiple problems:

首先,我应该检查文档才能使node.js正常工作。当我应该一直使用console.log()时,我只是假定alert()是一个函数。因此,一旦我意识到这一点,便能够在Cloud9中运行此文件:

First, I should have checked the documentation to get node.js to work. I just assumed alert() was a function when I should have been using console.log(). So once I realized this I was able to run this file in Cloud9:

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

第二,当我尝试安装库(inotify和fibre)时使用npm程序包管理器,将它们放置在我的工作目录的node_modules目录中:

Second, When I tried to install the libraries (inotify and fibers) using the npm package manager it placed them in the node_modules directory in my working directory:

/home/root/

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

... not the default Cloud9 root directory as I assumed it would:

/var/lib/cloud9

第三,我的密码已经导出,只需重新启动BeagleBone即可解决。

Third, my pins were already exported, which was fixed by simply restarting the BeagleBone.

最后,我发现在我的主目录中使用最新版本的 bonescript 创建新实例使我可以运行 blinkled.js 示例文件以及此文件可测试Bea上的所有模拟引脚命令行中的gleBone

Finally, I found that creating a new instance in my home directory with the latest version of bonescript allowed me to run the blinkled.js sample file, as well as this file which tests all analog pins on the BeagleBone from the command line.

这篇关于无法在BeagleBone上的Cloud9中运行骨骼脚本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆