OpenEmbedded layer for latest stable Node.js and io.js releases.
Stable releases of Node.js:
5.04.2(LTS)4.14.00.120.100.8
Stable releases of io.js:
3.33.23.13.02.52.42.32.22.12.01.81.71.61.51.41.31.21.11.0
nodejsnodejs-npmnodejs-dtracenodejs-systemtapnodejs-wafadmin(only with Node.js0.8)iojsiojs-npmiojs-dtraceiojs-systemtap
-
Add
meta-nodejslayer tosources/layers.txtmeta-nodejs,git://github.com/imyller/meta-nodejs.git,master,HEAD -
Add
meta-nodejslayer toEXTRALAYERSinconf/bblayers.confEXTRALAYERS +=" \ ${TOPDIR}/sources/meta-nodejs \ "
It is recommended that you define the preferred provider of Node engine in your local.conf. For example:
PREFERRED_PROVIDER_node = "nodejs"
PREFERRED_PROVIDER_node-native = "nodejs-native"With preferred provider selected you can use package name node in your recipe DEPENDS and RDEPENDS.
To build latest stable Node.js package:
If you have set PREFERRED_PROVIDER_node:
bitbake node or if you want to build Node.js:
bitbake nodejsor if you want to build io.js:
bitbake iojsIf you have built both nodejs and iojs to same root fs, you can resolve the conflict by running:
bitbake iojs nodejs iojs-native nodejs-native -c cleanall -fAdd Node.js or io.js as a dependency in recipe with RDEPENDS (for runtime) or DEPENDS (for build):
DEPENDS += " node" # Only if you have set the PREFERRED_PROVIDER_node
RDEPENDS_${PN} += " node" # Only if you have set the PREFERRED_PROVIDER_node or
DEPENDS += " nodejs"
RDEPENDS_${PN} += " nodejs"or
DEPENDS += " iojs"
RDEPENDS_${PN} += " iojs"Inherit npm-install build task classes in your recipe. This will automatically add node to your RDEPENDS_${PN} and node-native to DEPENDS.
meta-nodejs layer adds two new classes: npm and npm-install.
npm class defines following functions:
oe_runnpm: call cross-compilingnpmoe_runnpm_native: call native-compilingnpm
For example:
inherit npm
do_install() {
oe_runnpm install # Installs dependencies defined in package.json
}NPM_FLAGS: Extra command line arguments fornpmcalls made byoe_runnpm()NPM_ARCH: Override npm target architecture (defaults toTARGET_ARCH)
npm-install class inherits npm class and adds following build tasks (listed in their run order):
npm_install: runsnpm installin source directorynpm_shrinkwrap: runsnpm shrinkwrapin source directorynpm_dedupe: runsnpm dedupein source directory
You can disable one or more of these build tasks in the recipe with do_<taskname>[noexec] = "1":
do_npm_shrinkwrap[noexec] = "1"NPM_INSTALL_FLAGS: Extra command line arguments fornpmcalls made innpm_installtaskNPM_INSTALL: Parameters fornpm installcommand (such as specific package names)
