tessel / openwrt-tessel

OpenWrt build scripts and package feed for Tessel 2
Other
32 stars 14 forks source link

Using ngrok throws an error #62

Closed rashedtalukder closed 5 years ago

rashedtalukder commented 8 years ago

This would be a powerful ability for Tessel's to quickly and easily have a routed web address for deving with Ngrok. However, using the library on a T2 always throws the following:

events.js:141 throw er; // Unhandled 'error' event ^

Error: spawn ./ngrok ENOENT at exports._errnoException (util.js:870:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32) at onErrorNT (internal/child_process.js:344:16) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17) at Function.Module.runMain (module.js:443:11) at startup (node.js:139:18) at node.js:968:3

HipsterBrown commented 8 years ago

Hi @rashedtalukder, can you log the error coming from the child_process or post your code so I can try to debug this on my Tessel?

rashedtalukder commented 8 years ago

@HipsterBrown

It will probably help debug the best if you have the code: var ngrok = require('ngrok'); var options = { 'proto' : "http", 'addr' : 8090, 'authtoken' : "{{your auth token, or switch to basic auth}}", };

ngrok.connect(options, function(err, url){ if (!err){ console.log("Ngrok tunneled at " + url + ":" + options.addr); } else { console.log("Error: " + err); } });

danielduhh commented 7 years ago

Was this ever resolved? Im getting the same error.. Heres my code:

const express = require('express')
const app = express();
const ngrok = require('ngrok');

app.listen(8080, () => {
    console.log("live on port 8080");

    ngrok.connect(8080, (err, url) => {
        console.log(`error: ${err}, url: ${url}`)
    })

})

error:

events.js:160 throw er; // Unhandled 'error' event ^

Error: spawn ./ngrok ENOENT
    at exports._errnoException (util.js:1018:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3
HipsterBrown commented 7 years ago

@rashedtalukder @danielduhh After looking into this again, it appears to be an issue with finding a executable file -> https://github.com/bubenshchykov/ngrok/blob/master/index.js#L10

The package has a postinstall hook that attempts to install that expected executable based on your operating system -> https://github.com/bubenshchykov/ngrok/blob/master/postinstall.js#L39

I'm not sure if ngrok has a supported executable for Tessel's architecture, mipsel. If they do, you would need to download that file and add it to your .tesselinclude file.

nodebotanist commented 5 years ago

Is this a wontfix because it needs a binary? Trying to clean up the issues here.

HipsterBrown commented 5 years ago

@nodebotanist Yes, I'll close this issue as it is related to ngrok, not Tessel. Thanks for triaging. :clap: