RE: Making uEnv.txt Suit My Needs and Running Software/How Do I Put 'bonescript' in My Path...

Hello,

As many of us already know, I am working with the TMP36 and failing harder than ever for some reason on my BBB. I just noticed my error code for the software. It is stating that the BBB cannot find the ‘bonescript’ language that I am invoking.

Seth

P.S. How can I put the ‘bonescript’ language in my PATH so when I run the .js file, ‘bonescript’ is “noticed” and can be used? I am working directly in the /home/debian directory. Send guidance or assistance, i.e. either/or.

On Sat, 12 Aug 2017 19:00:05 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

Hello,

As many of us already know, I am working with the TMP36 and failing harder
than ever for some reason on my BBB. I just noticed my error code for the
software. It is stating that the BBB cannot find the 'bonescript' language
that I am invoking.

  Cut & paste the exact error message (along with the command line being
used to invoke the program).

  Bonescript is not a "language" per se, so much as an import
library/module for node.js which activates access to the BBB hardware. It
corresponds to the Python BBIO (various over the years) library.

Seth

P.S. How can I put the 'bonescript' language in my PATH so when I run the
.js file, 'bonescript' is "noticed" and can be used? I am working directly
in the /home/debian directory. Send guidance or assistance, i.e. either/or.

  If the bonescript module is not being found by node.js, that is one
thing, and changing your normal PATH variable probably won't help -- PATH
tells the OS where to look for executable programs; where those programs
look for import libraries is a different matter. If node.js is not being
found, then your PATH is likely really trashed, since it should be in one
of the standard directories (/bin, /usr/bin, etc.)

root@ELUSIVEUNICORN:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

(the above is from Windows 10 "BASH on Ubuntu on Windows" add-in, Debian
should be similar)

  Seeing the exact error message would help identify the type of problem
you have.

  Unfortunately I can't help with node.js -- the whole way of programming
in it just doesn't fit my mindset. A problem with Python would be more in
my realm.

Hello,

Here is the error message when I use sudo node tryTemp.js to run the .js file on my BBB in PuTTY.

module.js:491
throw err;
^

Error: Cannot find module ‘bonescript’
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object. (/home/debian/tryTemp.js:1:71)
at Module._compile (module.js:573:30)
at Object.Module._extensions…js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)

Oh and sir, the software I am using to invoke ‘bonescript’ is:

var b = require(‘bonescript’);

function readTemp() {
b.analogRead(‘P9_40’, displayTemp);
}

function displayTemp(reading) {
var millivolts = reading.value * 1800;
var Celsius = (millivolts - 500) / 10;
var Fahrenheit = (Celsius * 9/5) + 32
console.log(“Celsius=” + Celsius + “/tFahrenheit=” + Fahrenheit;
}

setInterval(readTemp, 8000);

Seth

P.S. Thank you for any support.

export NODE_PATH=/usr/local/lib/node_modules

Regards,

Hello,

Thank you again, sir.

Seth

On Sun, 13 Aug 2017 10:54:08 -0700 (PDT), Mala Dies
<functt@gmail.com> declaimed the following:

Hello,

Here is the error message when I use *sudo node tryTemp.js* to run the .js
file on my BBB in PuTTY.

  Hmmm, I thought more recent OS had renamed "node" to "nodejs" due to a
conflict with an amateur radio packet program.

module.js:491
   throw err;
   ^

Error: Cannot find module 'bonescript'

  Not a PATH error itself -- PATH found node.js (by whatever name).

  I'd have to study node.js documentation to find the answer (but since I
peaked ahead, I won't bother -- I'll just save that answer to my own
archive for future)

Hello Sir,

I tried this out. I used that BASH command and it did not locate my node_modules under /usr/local/lib for some reason. I have the 2 GB version: Linux beaglebone 4.9.37-ti-r47 #1 SMP PREEMPT Thu Jul 13 22:48:49 UTC 2017 armv7l GNU/Linux. Should I update to the latest release of Stretch?

Seth

P.S. I do not even have node on my system right now for some reason. Oh and I do not have bonescript located anywhere on my machine either. This is the issue since I am using an invocation of ‘bonescript’ via var b = require(‘bonescript’); in a .js file.