setup-node

Setup Node

Install Node from .nvmrc and install deps with yarn or npm. Run actions/checkout first.

Inputs

Input

Required

Default

Description

node-version-file

no

.nvmrc

Path to the file pinning the Node version. Defaults to .nvmrc at the repo root; point it at a per-side file (e.g. fe/.nvmrc) for monorepo jobs that build one workspace.

package-manager

no

yarn

Package manager for the install step and cache (yarn or npm). yarn runs yarn install; npm runs npm ci (or npm install when frozen-lockfile is false). If you are using the npm option, please migrate to yarn sooner than later. And reconsider your life choices.

cache

no

true

Whether to cache the package manager’s store (keyed by the resolved lockfile); when on it uses package-manager. Set to “false”/”” to disable – e.g. a monorepo per-side job with no root lockfile, or the pre-bootstrap template that has no committed lockfile yet (setup-node errors if cache is on and no lockfile resolves).

cache-dependency-path

no

Lockfile that keys the cache. Empty uses setup-node’s default lookup (root yarn.lock / package-lock.json); set e.g. fe/yarn.lock for a per-side job. Ignored when cache is disabled.

install

no

true

Install dependencies after setting up Node.

frozen-lockfile

no

true

Fail instead of updating the lockfile (yarn –frozen-lockfile / npm ci).

working-directory

no

.

Directory to run the install in.

Usage

- uses: actions/checkout@v6
- uses: FSHTech/github-actions/setup-node@v1