setup-node is a GitHub Action that downloads, installs, and configures a specified Node.js runtime in continuous integration workflows. It resolves version specifiers from semantic version ranges or aliases like "lts/*" against a remote manifest, selects the correct binary for the runner’s operating system and architecture, and can reuse previously installed versions from GitHub’s hosted tool cache.
The action accelerates repeat workflow runs by caching global package dependencies using a lock file as the cache key, restoring them automatically on subsequent runs. It manages version resolution through a semver range interpreter and fetches platform-aware binaries, ensuring reproducibility across different runner environments.
In addition to runtime installation and caching, setup-node provides the foundation for automating build, test, and lint steps in JavaScript and TypeScript projects. It installs dependencies via npm, Yarn, or pnpm and integrates with the workflow’s existing job steps to produce a fully configured Node.js environment.
The action is distributed as a reusable component in the GitHub Actions marketplace, requiring minimal configuration in a workflow YAML file to specify the Node.js version and optional cache settings.