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.
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)
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
At this point Cloud9 also stops responding and I have to reload the page to attempt to use it further.
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
No idea what I should put in there.
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?
UPDATE 1
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:
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);
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/
... not the default Cloud9 root directory as I assumed it would:
/var/lib/cloud9
Third, my pins were already exported, which was fixed by simply restarting the BeagleBone.
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.