1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Node.js on Tomato

Discussion in 'Tomato Firmware' started by ceckin, Aug 11, 2014.

  1. ceckin

    ceckin LI Guru Member

    Hi guys,

    I desperately need to get node.js (alongside with npm) working on tomato router (E4200) and Optware.

    I was wondering has anyone successfully compiled node on MIPS?
     
  2. lancethepants

    lancethepants Network Guru Member

    Last edited: Aug 12, 2014
  3. lancethepants

    lancethepants Network Guru Member

  4. ceckin

    ceckin LI Guru Member

    Thank you for the immediate response.

    Installed Tomatoware and the Node build, however im getting JS errors in both node and NPM

    For example:

    Code:
    fs.js:481
      var r = binding.read(fd, buffer, offset, length, position);
      ^
    Error: Offset is out of bounds
      at Object.fs.readSync (fs.js:481:19)
      at Object.fs.readFileSync (fs.js:315:28)
      at Object.Module._extensions..js (module.js:473:44)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
      at node.js:906:3
    Probably a tomato-specific quirk is causing this. Ill try to track it down.
     
  5. lancethepants

    lancethepants Network Guru Member

    Just as a quick note, entware is installed to /opt of course, but Tomatoware needs to be installed to a different location. I use the /mmc version, but they can't both occupy /opt, and have to be separate. Maybe that could be the issue. I was successful to get that Log.io working last night.
     
  6. ceckin

    ceckin LI Guru Member

    I've been trying to get this working for a while now, but i have weird issues.

    If i use two locations (/opt and /jffs, as i use Shibby), after i properly set /jffs/etc/profile, i still get Segmentation fault

    However if i overwrite /opt with the content of tomatoware, i can get node running, but it gives the 481 error mentioned above.

    I'm running: Shibby 121 on E4200 / gcc (GCC) 4.6.4

    I can get Node's version: v0.10.30, but everything else results in "Segmentation fault" (guess a lib gone mad).

    Tried setting NODE_PATH as well - no chance

    EDIT:

    As always - its my own fault for not reading the setup correctly. I've user hard-float and as such Node was crashing (because it was compiled against soft-float). Once i've corrected this - everything works as expected and Node is working flawlessly (for now), more testing on route.

    Thank you very much for this lancethepants, you the man
     
    Last edited: Aug 18, 2014
  7. lancethepants

    lancethepants Network Guru Member

Share This Page