The nodejs
plugin is useful when working with Node.js and npm JavaScript based parts.
This plugin can only be used with a base of either core18
and core
. For core20
, use the npm plugin instead.
Additional features and syntax are dependent on which base is being used, as outlined below:
The plugin uses node to install dependencies from package.json
. It also sets up binaries defined in package.json
by adding them to PATH
.
This plugin uses the common plugin keywords as well as those for “sources”. For more information, see Snapcraft parts metadata.
This plugin uses the following plugin-specific keywords:
nodejs-version
(string; default: 8.12.0)nodejs-version: 8.12.0
nodejs-package-manager
(string; default: yarn)npm
or yarn
(default).nodejs-yarn-version
(string)nodejs-yarn-version: v1.19.1
For examples, search GitHub for projects already using the plugin.
Requires Snapcraft version 3.x.
This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.
Last updated 7 months ago. Help improve this document in the forum.