Files
modules/nodejs
2024-03-07 00:34:50 +05:00
..
2024-03-05 21:13:17 +05:00
2024-03-05 21:13:17 +05:00
2024-03-05 21:13:17 +05:00

display_name, description, icon, maintainer_github, verified, tags
display_name description icon maintainer_github verified tags
nodejs Install Node.js via nvm ../.icons/node.svg TheZoker false
helper

nodejs

Automatically installs Node.js via nvm. It can also install multiple versions of node and set a default version. If no options are specified, the latest version is installed.

module "nodejs" {
  source   = "registry.coder.com/modules/nodejs/coder"
  version  = "1.0.8"
  agent_id = coder_agent.example.id
}

Install multiple versions

This installs multiple versions of Node.js:

module "nodejs" {
  source   = "registry.coder.com/modules/nodejs/coder"
  version  = "1.0.8"
  agent_id = coder_agent.example.id
  node_versions = [
    "18",
    "20",
    "node"
  ]
  default_node_version = "20"
}

Full example

A example with all available options:

module "nodejs" {
  source             = "registry.coder.com/modules/nodejs/coder"
  version            = "1.0.8"
  agent_id           = coder_agent.example.id
  nvm_version        = "v0.39.7"
  nvm_install_prefix = "/opt/nvm"
  node_versions = [
    "16",
    "18",
    "node"
  ]
  default_node_version = "16"
}