OpenEmbedded layer for latest stable Node.js releases.
-
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 \ "
-
Run
oebb.sh update
- To build latest stable Node.js package:
bitbake nodejs
Add Node.js as a dependency in recipe:
RDEPENDS_${PN} += "nodejs"
Inherit npm
or npm-install
build task classes in your recipe.
meta-nodejs
layer adds two new classes: npm
and npm-install
.
npm
defines the oe_runnpm
command which will call cross-compiling npm
.
For example:
inherit npm
do_install() {
oe_runnpm install # Installs dependencies defined in package.json from in source directory to node_modules
}
You can define extra command line arguments for npm
calls made by oe_runnpm()
by appending them to NPM_FLAGS
variable.
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"
-
You can define extra command line arguments for
npm
command by appending them toNPM_INSTALL_FLAGS
variable. -
you can define parameters for
npm install
command (such as specific package names) by appending them toNPM_INSTALL
variable.