What's new

node.js (v4 or later) and npm?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

kun1he2

New Around Here
Has anyone managed to get "node.js" and "npm" working successfully on any Asus routers, preferably the AC68U?

I've managed to get the older node.js v0.10.29 along with npm running - unfortunately, it appears that the npm package "homebridge", which I'm trying to get running, requires a newer node.js version.

I've also tried the node.js v6.3.1 package that is available with Optware-NG.
Installation succeeds and "node -v" returns "v6.3.1".
However, "npm -v" returns "Illegal instruction" error.

Perhaps the binaries were compiled with hard float option? Or perhaps the kernel used by Asus is too old?
 
Thanks, looking forward to it!

Btw, not sure if it helps, but the node v6.3.1 package from Optware-NG which fails with "Illegal instruction" shows the following for "node --v8-options":

target arm v7 vfp3 softfp
ARMv8=0 ARMv7=1 VFP3=1 VFP32DREGS=1 NEON=0 SUDIV=0 MLS=1UNALIGNED_ACCESSES=1 MOVW_MOVT_IMMEDIATE_LOADS=0 COHERENT_CACHE=0 USE_EABI_HARDFLOAT=0
 
You are right - although readelf shows node binary is a softfloat exacutable - it fails with "Illegal instruction". There will be two node packages for armv7 - a legacy one for softfloat arch and 6.7 for hardfloat arch.
 
Ok? So how exactly do you install NPM and/or Node.JS onto entware-ng on the ASUS RT-AC68U?!

I do not see any details here... :confused:
 
Some of us are a little "lazy" and just browse via mobile looking for "shortcuts" while we work on other things, so I will help the other lazy slobs who already have entware-ng installed, such as myself.

Turns out that node.js is already in entware-ng - https://pkg.entware.net/binaries/armv7/Packages.html

Install command:
opkg install node

Check Node:
node -v --> Response: v6.7.0

Check NPM:
npm -v --> Response: Illegal Instruction

That is the HARDFLOAT version, meanwhile you can install the SOFTFLOAT version:

Install command:
opkg install node_legacy

Check Node:
node -v --> Response: v0.10.46

Check NPM:
npm -v --> Response: Segmentation Fault

I guess we have "buggy" or handicapped installers, but neither has a working installation of NPM so if someone knows how to get ANY version of NPM installed onto entware-ng (with instructions) that would be helpful. I know kun1he2 is after "homebridge", but there are other packages we might be able to use that do not require the "new" stuff, so maybe he can share how he installed a working version of NPM... ;)

Quick Spec Check:
Router: RT-AC68U
rmerlin: 380.65

Bonus Questions:
entware-ng: ?How do we check what version we have? Also, how do we update our entware-ng install?

*now crawl this Google*

:confused:
 
Last edited:
softfloat != works on ARM without HW FP.

Not sure about "latest/greatest" Asus, no hope to run v6 on RT-AC88U and older models. You can try v0.10.

Another problem is that 256MB or even 512MB RAM is not sufficient to compile NPM packages. Is there a cross compilation tool available? I'm not so sure. Your other hope is to get it compiled on a compatible ARMv7 with more RAM, and transplant the NPM packages to run on Asus router with v0.10.

I have been running my Kazoo It! blog on node.js v0.10 with a 128MB RAM x86 machine. So it's possible. In my case, it fulfils my need well.
 
Thanks for reporting - 0.10.46 segfaults. Please use 0.10.44
Code:
root@ws880:/tmp/home/root# cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1599.07

processor       : 1
BogoMIPS        : 1595.80

Features        : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware        : Northstar Prototype
Revision        : 0000
Serial          : 0000000000000000
root@ws880:/tmp/home/root# node -v
v0.10.44
root@ws880:/tmp/home/root# npm -v
2.15.0
To install the old version from archive -
Code:
root@ws880:/tmp/home/root# opkg remove node_legacy
Removing package node_legacy from root...
root@ws880:/tmp/home/root# wget http://pkg.entware.net/binaries/armv7/archive/node_legacy_v0.10.44-1_armv7soft.ipk
Connecting to pkg.entware.net (81.4.123.217:80)
node_legacy_v0.10.44 100% |*****************************************************************************|  3957k  0:00:00 ETA
root@ws880:/tmp/home/root# opkg install node_legacy_v0.10.44-1_armv7soft.ipk
Multiple packages (node_legacy and node_legacy) providing same name marked HOLD or PREFER. Using latest.
Installing node_legacy (v0.10.44-1) to root...
Configuring node_legacy.
 
softfloat != works on ARM without HW FP.

Not sure about "latest/greatest" Asus, no hope to run v6 on RT-AC88U and older models. You can try v0.10.

Another problem is that 256MB or even 512MB RAM is not sufficient to compile NPM packages. Is there a cross compilation tool available? I'm not so sure. Your other hope is to get it compiled on a compatible ARMv7 with more RAM, and transplant the NPM packages to run on Asus router with v0.10.

Most of the ARM development these days on small ARM's is for hardfloat (armhf) - the FPU is optional in Cortex-A9. Not saying that A9 is slow, just need to take this into consideration in your buildroot config. The buildroot in RMerlin's has this already in place.

Node and NPM is very tight on an 256MB machine, even on a 512MB machine - it'll run, but not very well - might consider running things on another machine - Pi3 runs Node.JS, NPM, and many other similar items very well, and can complement your current Router*...

* Pi3 - mostly due to more RAM and possible storage, and Cortex-A53 there is pretty good...
 
Code:
admin@RT-AC5300:/tmp/home/root# opkg install node
Installing node (v8.16.0-2) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/node_v8.16.0-2_armv7-2.6.ipk
Installing libnghttp2 (1.38.0-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libnghttp2_1.38.0-1_armv7-2.6.ipk
Installing libuv (1.24.1-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libuv_1.24.1-1_armv7-2.6.ipk
Installing libhttp-parser (2.9.2-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libhttp-parser_2.9.2-1_armv7-2.6.ipk
Configuring libnghttp2.
Configuring libhttp-parser.
Configuring libuv.
Configuring node.
======
admin@RT-AC5300:/tmp/home/root# opkg install node-npm
Installing node-npm (v8.16.0-2) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/node-npm_v8.16.0-2_armv7-2.6.ipk
Configuring node-npm.
======
admin@RT-AC5300:/tmp/home/root# npm install -g homebridge
/opt/bin/node: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
admin@RT-AC5300:/tmp/home/root# error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
======
opkg upgrade
Removing obsolete file /opt/lib/libssl.so.1.0.0.
Removing obsolete file /opt/lib/libcrypto.so.1.0.0.
# UPDATED to libcrypto.so.1.1
======
admin@RT-AC5300:/tmp/home/root# npm install -g homebridge
Illegal instruction

Probably have to buy Raspberry Pi :(
 
Probably have to buy Raspberry Pi

Node is problematic - not just on embedded ARM, but also MIPS - it can run, but one needs to compile pretty much everything for the platform it's being used on.

RPi supports this out of the box with Raspbian...
 
Has anyone managed to get "node.js" and "npm" working successfully on any Asus routers, preferably the AC68U?

I've managed to get the older node.js v0.10.29 along with npm running - unfortunately, it appears that the npm package "homebridge", which I'm trying to get running, requires a newer node.js version.

I've also tried the node.js v6.3.1 package that is available with Optware-NG.
Installation succeeds and "node -v" returns "v6.3.1".
However, "npm -v" returns "Illegal instruction" error.

Perhaps the binaries were compiled with hard float option? Or perhaps the kernel used by Asus is too old?
New node versions for arm require hardfloat hardware support. 0.10.xx is the last version, that can be compiled for arm without hard float.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top