Skip to main content
Documentation for @rules_nodejs@v6.7.3 View source
Module extensions for nodejs toolchain registration in MODULE.bazel Example usage, assuming a .nvmrc file is present in the same directory as the MODULE.bazel file:

Module extension: node

Tag: toolchain

name
default:"nodejs"
Base name for generated repositories
string
default:"22.22.0"
Version of the Node.js interpreter
label
default:"None"
The .nvmrc file containing the version of Node.js to use.This is recommended to ensure Bazel uses the same Node.js version as non-Bazel tooling. If set then the version found in the .nvmrc file is used instead of the one specified by node_version.
boolean
default:"False"
Set headers field in NodeInfo provided by this toolchain.Required to compile native code into a Node.js binary. This setting creates a dependency on a c++ toolchain.
list of strings
List of URLs to use to download Node.js.Each entry is a template for downloading a node distribution.The {version} parameter is substituted with the node_version attribute, and {filename} with the matching entry from the node_repositories attribute.
dictionary: String → List of strings
default:"{}"
Custom list of node repositories to useA dictionary mapping Node.js versions to sets of hosts and their corresponding (filename, strip_prefix, sha256) tuples. You should list a node binary for every platform users have, likely Mac, Windows, and Linux.By default, if this attribute has no items, we’ll use a list of all public Node.js releases.