项目作者: nxhack

项目描述 :
OpenWrt Project Node.js packages. v10.x LTS and v12.x LTS and v14.x LTS
高级语言: Makefile
项目地址: git://github.com/nxhack/openwrt-node-packages.git
创建时间: 2016-04-20T01:15:09Z
项目社区:https://github.com/nxhack/openwrt-node-packages

开源协议:GNU General Public License v2.0

下载


OpenWrt Node.js Packages (nodejs)

Description

OpenWrt Node.js Packages : for Head (Development branch)

Note: support arches are aarch64, arm, x86_64

License

See LICENSE file.

Usage

Add the following line to feeds.conf or feeds.conf.default.

  1. src-git node https://github.com/nxhack/openwrt-node-packages.git

Run

  1. ./scripts/feeds update node
  2. rm ./package/feeds/packages/node
  3. rm ./package/feeds/packages/node-*
  4. ./scripts/feeds install -a -p node
  5. make defconfig

Request to add a package is welcome

If you want a new module (native module) that requires a precompiled binary, please open the issue.

Note

If you want to use with 23.05, see openwrt-23.05 branch (Current stable series)

On the host side, the following preparations are required.

  • Unix prerequisites
  • To build a 32-bit target, gcc-multilib, g++-multilib are required.
    1. sudo apt-get install gcc-multilib g++-multilib
  • The libatomic package is required. (Install the 32-bit library at the same time, if necessary).

Illegal instruction issue

V8 JIT code generates FP instruction. Node.js does not work without hardware FPU.

If you are running nodejs on the Atheros AR71xx/AR933x, MediaTek MT76x8, it will not work because there is no hardware FPU.
ARM cores without vfp or neon (such as bcm53xx) will not work either.

Enable Inspector

Processor ICU Inspector
32bit Disable NO
32bit small-icu YES
64bit Disable NO
64bit small-icu YES
64bit system-icu YES

Debugging Guide Nice to use Chrome DevTools.

Note: ICU currently supports only LITTLE ENDIAN.

Note about mDNS and homebridge

Read this document: mDNS Options

If you want, you can install the OpenWrt mDNS package (umdns / avahi-dbus-daemon / mdnsresponder).

(1)
Some OpenWrt / Lede images have built in dnscrypt-proxy package, which by default listening on 5353 port.

In that case, installed avahi-daemon will not start on ipv4 interface, only on ipv6 because ipv4 port is taken.

This will lead to strange issue: your homebrdge accessory will be visible in ‘Home’ app, but can’t finish pairing.

To fix this, you have to stop and disable dnscrypt-proxy

Also, you have to enable: dbus and avahi-daemon services to start automatically, i.e for Lede:

  1. /etc/init.d/dbus enable
  2. /etc/init.d/avahi-daemon enable

(2)
avahi on home network

Please read this document. ‘Why avahi and bonjour don’t work on your home network

IGMP-querier will solve your problem.

OpenWrt allows “multicast_querier” (IGMP-querier) to be set when “igmp_snooping” is enabled.

OpenWrt custom packages available: https://github.com/nxhack/openwrt-custom-packages

Low memory

Specify v8-options.

  1. --optimize_for_size --max_old_space_size=128 --gc_interval=100

For Reference: Avoid Garbage.

Or use swap.

Modules that use pre-compiled binary (native module)

  1. node-authenticate-pam
  2. node-aws-crt
  3. node-bcryp
  4. node-bignum
  5. node-bluetooth-hci-socket
  6. node-bufferutil
  7. node-deasync
  8. node-ejdb2_node
  9. node-epoll
  10. node-expat
  11. node-ffi-napi (ffi-napi, ref-napi)
  12. node-fuse-bindings
  13. node-hid
  14. node-pty-prebuilt-multiarch
  15. node-i2c-bus
  16. node-leveldown
  17. node-megahash
  18. node-mdns
  19. node-net-ping (raw-socket)
  20. node-openzwave-shared
  21. node-pi-spi
  22. node-pty
  23. node-rpio
  24. node-serialport-bindings
  25. node-sleep
  26. node-spi-device
  27. node-sqlite3
  28. node-statvfs
  29. node-ubus
  30. node-usb
  31. node-utf-8-validate
  32. node-zigbee2mqtt (@serialport/bindings,unix-dgram)

Other modules can be installed by ‘npm install’.

Package Guidelines

See CONTRIBUTING.md file.