Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running npm install tessel-av. buffertools precompiled binary missing. #1051

Closed
JustinGOSSES opened this issue Oct 19, 2016 · 10 comments
Closed
Assignees

Comments

@JustinGOSSES
Copy link

JustinGOSSES commented Oct 19, 2016

I've went through the instructions for the tessel2 camera.js module instructions twice (https://tessel.github.io/t2-start/modules/camera.html) and repeated the error below. The error text suggests I post here. I'm new to tessel2, so this could very well just be me messing up somewhere.

The error is asking for a precompiled binary. The folder it is pointing to is empty (.tessel/binaries/buffertools-2.1.4-Release-node-v46-linux-mipsel/Release/buffertools.node).
I found a precompiled binary for buffertools for windows in their github repo, but not OSX. Reinstalling that node module doesn't populate the folder it is looking in for the precompiled binary.

---- edit for @HipsterBrown
"which node" on my machine = "v5.4.0"
When I try "t2 version", I get = "Error: getaddrinfo ENOTFOUND builds.tessel.io builds.tessel.io:443". If I try "t2 --version", I get a message telling me the right syntax is without the "--". I am able to successfully run some basic LED blinking and previous webserver projects.

$ t2 run camera.js
INFO Looking for your Tessel...
INFO Connected to dorfTheT2.
INFO Building project.
WARN Pre-compiled module is missing: buffertools@2.1.4.
WARN Please an file issue at https://github.com/tessel/t2-cli/issues/new with this warning.
WARN
WARN This warning might be caused by one of the following:
WARN
WARN 1. A pre-compiled binary has not yet been built for this module.
WARN 2. The binary didn't compile correctly for the platform that you're developing on.
WARN Binaries that are Linux-only or even OpenWRT-specific may cause this issue.
WARN Try to npm install --force the affected module, then rerun your deployment command.
WARN 3. The binary may be platform specific and impossible to compile for OpenWRT.
ERR! { [Error: ENOENT: no such file or directory, stat '/Users/justingosses/.tessel/binaries/buffertools-2.1.4-Release-node-v46-linux-mipsel/Release/buffertools.node']
ERR! errno: -2,
ERR! code: 'ENOENT',
ERR! syscall: 'stat',
ERR! path: '/Users/justingosses/.tessel/binaries/buffertools-2.1.4-Release-node-v46-linux-mipsel/Release/buffertools.node' }
INFO Writing project to RAM on dorfTheT2 (182.272 kB)...
INFO Deployed.
INFO Running camera.js...
node: '/tmp/remote-script/node_modules/buffertools/build/Release/buffertools.node' is not an ELF file
module.js:327
throw err;
^

Error: Cannot find module './build/Debug/buffertools.node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/tmp/remote-script/node_modules/buffertools/buffertools.js:1:273)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

@HipsterBrown
Copy link
Contributor

@JustinGOSSES What version of Node are you using? And could you also run t2 --version and reply with that output as well?

@rwaldron or @reconbot might know more about this.

@JustinGOSSES
Copy link
Author

@HipsterBrown "which node" on my machine = "v5.4.0". When I try "t2 version", I get = "Error: getaddrinfo ENOTFOUND builds.tessel.io builds.tessel.io:443". If I try "t2 --version", I get a message telling me the right syntax is without the "--".
I am able to successfully run some basic LED blinking and previous webserver projects.

@rwaldron
Copy link
Contributor

Node 5.x.x is not an officially supported version. t2-cli aligns with the LTS releases only, which are currently: 4.6.1 and 6.9.1. Most of the time Node 5.x.x might work, but it's not guaranteed to do so. You can use nvm to install an appropriate version, but you'll want to uninstall t2-cli

  1. uninstall the globally installed t2-cli
  2. use nvm to install and use an appropriate version of node
  3. npm install t2-cli -g

@rwaldron rwaldron self-assigned this Oct 20, 2016
@rwaldron
Copy link
Contributor

I was able to produce the following failure by doing:

mkdir test && cd test && t2 init && npm install tessel-av && echo "require('tessel-av')" > index.js 

Shut off wifi/disconnect internet, then:

t2 run index.js

And this is what happened:

$ t2 run index.js
INFO Looking for your Tessel...
INFO Connected to Tessel-02A30EDC9151.
INFO Building project.
WARN Pre-compiled module is missing: buffertools@2.1.4.
WARN Please an file issue at https://github.com/tessel/t2-cli/issues/new with this warning.
WARN
WARN This warning might be caused by one of the following:
WARN
WARN 1. A pre-compiled binary has not yet been built for this module.
WARN 2. The binary didn't compile correctly for the platform that you're developing on.
WARN    Binaries that are Linux-only or even OpenWRT-specific may cause this issue.
WARN    Try to npm install --force the affected module, then rerun your deployment command.
WARN 3. The binary may be platform specific and impossible to compile for OpenWRT.
ERR! { [Error: ENOENT: no such file or directory, stat '/Users/rwaldron/.tessel/binaries/buffertools-2.1.4-Release-node-v46-linux-mipsel/Release/buffertools.node']
ERR!   errno: -2,
ERR!   code: 'ENOENT',
ERR!   syscall: 'stat',
ERR!   path: '/Users/rwaldron/.tessel/binaries/buffertools-2.1.4-Release-node-v46-linux-mipsel/Release/buffertools.node' }
INFO Writing project to RAM on Tessel-02A30EDC9151 (175.616 kB)...
INFO Deployed.
INFO Running index.js...
node: '/tmp/remote-script/node_modules/tessel-av/node_modules/mjpeg-consumer/node_modules/buffertools/build/Release/buffertools.node' is not an ELF file
module.js:339
    throw err;
    ^

Error: Cannot find module './build/Debug/buffertools.node'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/tmp/remote-script/node_modules/tessel-av/node_modules/mjpeg-consumer/node_modules/buffertools/buffertools.js:1:273)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

Then, I tried the other command that you said failed (while the internet was still disconnected):

$ t2 version
INFO Looking for your Tessel...
INFO Connected to Tessel-02A30EDC9151.
ERR! Error: getaddrinfo ENOTFOUND builds.tessel.io builds.tessel.io:443

Looks like we need to provide guidance when internet connection is required.

rwaldron added a commit that referenced this issue Oct 20, 2016
rwaldron added a commit that referenced this issue Oct 20, 2016
@JustinGOSSES
Copy link
Author

JustinGOSSES commented Oct 21, 2016

The "Error: getaddrinfo" error seems like it was due to not being connected to the right wifi as you predicted, but the buffertools error replicated for me three times. I checked I was on the right node version (used 4.6.1), internet was connected between each step. I also followed the instructions here to uninstall and install t2-cli.

I got things to work and the error to go away by using node-gyp to compile buffertools locally and then change the folder name of /Users/myusername/.tessel/binaries/buffertools-2.1.4-Debug-node-v46-linux-mipsel/Release/buffertools.node' to /Users/myusername/.tessel/binaries/buffertools-2.1.4-Debug-node-v46-linux-mipsel/Debug/buffertools.node, so that it could be found. The first time I ran node-gyp it created a folder structure with Release in places of Debug as the folder names. The second time I used the --debug flag, but the last folder was still named Release not debug, so I manually changed it.

The only other complication was the webcam was trying to use port 8080, which is the same port camera.js was trying to use, resulting in an another error. I switched the camera.js code to port 8000 and everything works fine.

@rwaldron
Copy link
Contributor

but the buffertools error replicated for me three times

I suspect the cache directory is corrupted. Do this:

rm -r ~/.tessel/binaries/buffertools-2.1.4-Debug-node-v46-linux-mipsel

The only other complication was the webcam was trying to use port 8080, which is the same port camera.js was trying to use, resulting in an another error. I switched the camera.js code to port 8000 and everything works fine.

There should be no reason to modify the source in the module, the port can be set via the constructor:

https://github.com/tessel/tessel-av/blob/master/lib/camera.js#L80-L83

I will work on writing better docs

@rwaldron
Copy link
Contributor

@rwaldron
Copy link
Contributor

If this is ready for closing, feel free to his the button below 👍

@JustinGOSSES
Copy link
Author

JustinGOSSES commented Oct 21, 2016

Yep, must have been corrupted cache. It ran fine, and without having to generate the binaries manually, once I removed the cache directory and let buffertools in the cache directory get regenerated during the "npm install tessel-av". 👍

@rwaldron
Copy link
Contributor

That's great news. Also, I updated tessel-av to use a fork of mjpeg-consumer that doesn't have compiled binary deps.

rwaldron added a commit that referenced this issue Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants