OpenEmbedded layer for latest stable Node.js and io.js releases.
Stable releases of Node.js:
5.0
4.2
(LTS)4.1
4.0
0.12
0.10
0.8
Stable releases of io.js:
3.3
3.2
3.1
3.0
2.5
2.4
2.3
2.2
2.1
2.0
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
nodejs
nodejs-npm
nodejs-dtrace
nodejs-systemtap
nodejs-wafadmin
(only with Node.js0.8
)iojs
iojs-npm
iojs-dtrace
iojs-systemtap
-
Add
meta-nodejs
layer tosources/layers.txt
meta-nodejs,git://github.com/imyller/meta-nodejs.git,master,HEAD
-
Add
meta-nodejs
layer toEXTRALAYERS
inconf/bblayers.conf
EXTRALAYERS +=" \ ${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 nodejs
or if you want to build io.js:
bitbake iojs
If 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 -f
Add 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-compilingnpm
oe_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 fornpm
calls 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 install
in source directorynpm_shrinkwrap
: runsnpm shrinkwrap
in source directorynpm_dedupe
: runsnpm dedupe
in 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 fornpm
calls made innpm_install
taskNPM_INSTALL
: Parameters fornpm install
command (such as specific package names)