whatisgithub

What is setup-node?

actions/setup-node — explained in plain English

Analysis updated 2026-06-26

4,793TypeScriptAudience · developerComplexity · 1/5Setup · easy

In one sentence

An official GitHub Action that installs a specific version of Node.js into your CI workflow with built-in caching for the runtime and for npm, yarn, or pnpm packages to speed up repeated runs.

Mindmap

mindmap
  root((setup-node))
    What it does
      Install Node.js in CI
      Cache runtime version
      Cache npm yarn pnpm
    Version Formats
      Major version like 22
      Precise like 22.17.1
      Alias like lts iron
    Package Managers
      npm auto-cached v5
      yarn support
      pnpm support
    Features
      Private registry auth
      Fallback download
      Few YAML lines to use
    Tech Stack
      TypeScript
      GitHub Actions YAML
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Install a specific Node.js version in a GitHub Actions workflow so your tests and builds always run on the right runtime.

USE CASE 2

Cache npm or pnpm packages across workflow runs to avoid re-downloading all dependencies every time CI triggers.

USE CASE 3

Authenticate with a private npm registry in CI by letting setup-node configure the credentials token automatically.

What is it built with?

TypeScriptGitHub ActionsNode.jsnpmyarnpnpmYAML

How does it compare?

actions/setup-nodelinuxhsj/openclaw-zero-tokenlmstudio-ai/lms
Stars4,7934,7954,799
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity1/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
No license information is mentioned in the explanation.

So what is it?

This is an official GitHub Action that installs a specific version of Node.js into a GitHub Actions workflow. GitHub Actions is GitHub's built-in system for automating tasks like running tests, building code, or deploying software whenever you push changes to a repository. Many of those tasks require Node.js to be available, and this action handles fetching, caching, and configuring the right version so you do not have to do it manually in each workflow. You specify the Node.js version you want using standard version notation, such as a major version number like 22, a precise version like 22.17.1, or aliases like lts/iron for the current long-term support release. The action checks a local cache on the runner first to avoid downloading the same version repeatedly, which speeds up workflows that run frequently. If the version is not cached, it downloads from GitHub's own node-versions releases or falls back to the official Node.js distribution servers. The action also handles dependency caching for npm, yarn, and pnpm. When caching is enabled, it saves the packages your project downloads so they do not have to be fetched from the internet on every workflow run. Starting with version 5, npm caching is enabled automatically when your package.json declares npm as the package manager. For private package registries, the action can configure authentication tokens so that npm or yarn can install packages that require credentials. Using it in a workflow requires just a few lines of YAML. You add a step that references actions/setup-node with your chosen version, and from that point on the rest of the workflow has access to the node and npm commands at that version. The action is maintained by GitHub and is one of the most widely used actions in the ecosystem.

Copy-paste prompts

Prompt 1
Show me the YAML to add setup-node to my GitHub Actions workflow and install Node 22 LTS before running my test suite.
Prompt 2
How do I enable npm dependency caching in setup-node to make my GitHub Actions workflow faster?
Prompt 3
How do I use setup-node to authenticate with a private npm registry so my workflow can install packages that require a token?
Prompt 4
What's the difference between specifying '22', '22.17.1', and 'lts/iron' as the node-version in setup-node?
Prompt 5
How do I use setup-node with pnpm instead of npm and still get dependency caching?

Frequently asked questions

What is setup-node?

An official GitHub Action that installs a specific version of Node.js into your CI workflow with built-in caching for the runtime and for npm, yarn, or pnpm packages to speed up repeated runs.

What language is setup-node written in?

Mainly TypeScript. The stack also includes TypeScript, GitHub Actions, Node.js.

What license does setup-node use?

No license information is mentioned in the explanation.

How hard is setup-node to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is setup-node for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.