The nodejs plugin

The nodejs plugin is useful when working with Node.js or npm JavaScript based parts.

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.

Additionally, this plugin uses the following plugin-specific keywords:

  • nodejs-version (string)
    The version of node.js you want the snap to run on.
  • nodejs-package-manager (string; default: yarn)
    The language package manager to use to drive installation of node packages. Can be either npm or yarn (default).
  • nodejs-yarn-version (string)
    The version of the yarn package manager to use to drive installation of node packages.

For examples, search GitHub for projects already using the plugin.

This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.

Last updated 2 months ago. Help improve this document in the forum.