tessel / t2-cli

Tessel 2 Command Line Interface
MIT License
114 stars 56 forks source link

t2 run ends with ENOENT: no such file or directory, open 'http2' #1678

Open remotevision opened 5 years ago

remotevision commented 5 years ago

When using "@google-cloud/iot": "^1.1.3" I get this error message:

ERR! Error: ENOENT: no such file or directory, open 'http2'

To repeat this, simply add "@google-cloud/iot": "^1.1.3" as a dependency, and insert const iot = require("@google-cloud/iot"); at the top of your index file.

$ t2 run index.js
INFO Looking for your Tessel...
INFO Connected to terrarium.
INFO Building project.
ERR! Error: ENOENT: no such file or directory, open 'http2'

I tried adding http2 to the list of built-ins based on the resolution for #757 but that caused other errors so I backed off.

Other Info:

INFO Tessel Environment Versions:
INFO t2-cli: 0.1.22
INFO t2-firmware: 0.2.0
INFO Node.js: 8.11.3
HipsterBrown commented 5 years ago

Thanks for creating an issue @remotevision. I believe I have traced the root of the error to @grpc/grpc-js, which is a nested dependency of @google-cloud/iot. I'm not sure why the http2 module is not showing up on Tessel, so I'll try recreating the error this week and see if I can solve the issue.

remotevision commented 5 years ago

thanks. yep, thats where I ended up. I tried adding http2 as a direct dependency but that didn't help either.

remotevision commented 5 years ago

@HipsterBrown I was able to get a little further using these options

$ t2 run index.js --binopts="--experimental-modules" --full

output:

INFO Looking for your Tessel...
INFO Connected to terrarium.
INFO Building project.
INFO Writing project to RAM on terrarium (10810.368 kB)...
INFO Deployed.
INFO Running index.js...
(node:1762) ExperimentalWarning: The ESM module loader is experimental.
Error: @grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0

Tried updating node on the tessel via opkg

root@terrarium:~# opkg install node
Package node (v8.11.3-1) installed in root is up to date.
remotevision commented 4 years ago

@HipsterBrown curious if you've had any time to look into this further?