The smartest way to set up Node.js in GitHub Actions.
Zero guesswork. Maximum speed. Built for modern CI.
Please note: We take our GitHub action's security and users' trust very seriously. If you believe you have found a security issue in any of our GitHub action, please responsibly disclose by contacting us at security@anantacloud.com.
Most Node setup actions stop at installation.
This one goes further.
- Auto-detects package manager (npm, yarn, pnpm)
- Supports
.nvmrc,.node-version,package.json,.tool-versions - Semver-aware version resolution
- Cross-platform (Linux, macOS, Windows)
- Built-in dependency install
- Matrix-aware intelligent caching
- Registry + authentication support
- Mirror support for Node.js binaries
- Debug mode for deep CI visibility
Think of it as setup-node, but evolved.
- name: Setup Node.js
uses: anantacloud-actions/setup-node@v1- uses: anantacloud-actions/setup-node@v1
with:
node-version: 20- uses: anantacloud-actions/setup-node@v1
with:
node-version-file: .nvmrc- uses: anantacloud-actions/setup-node@v1
with:
cache: npm- uses: anantacloud-actions/setup-node@v1
with:
registry-url: https://registry.npmjs.org
token: ${{ secrets.NPM_TOKEN }}- uses: anantacloud-actions/setup-node@v1
with:
install: false| Name | Description | Required | Default |
|---|---|---|---|
node-version |
Version spec (e.g. 18, 20.x, >=18.0.0) | β | - |
node-version-file |
File with version (e.g. .nvmrc, package.json) | β | - |
architecture |
Target architecture (x86, x64, arm64) | β | system |
check-latest |
Resolve latest matching version | β | false |
registry-url |
Registry URL for npm/yarn/pnpm | β | - |
scope |
Scope for registry authentication | β | repo owner |
token |
Auth token for registry or downloads | β | github token |
cache |
Package manager cache (npm, yarn, pnpm) | β | auto |
package-manager-cache |
Enable/disable automatic caching | β | true |
cache-dependency-path |
Path(s) to dependency files | β | auto |
mirror |
Alternative Node.js download mirror | β | nodejs.org |
mirror-token |
Token for mirror authentication | β | - |
install |
Install dependencies automatically | β | true |
debug |
Enable debug logging | β | false |
| Name | Description |
|---|---|
node-version |
Installed Node.js version |
node-versionnode-version-file- Error if none provided
| File Found | Manager |
|---|---|
| pnpm-lock.yaml | pnpm |
| yarn.lock | yarn |
| none | npm |
| Manager | Command |
|---|---|
| npm | npm ci |
| yarn | yarn install --frozen-lockfile |
| pnpm | pnpm install --frozen-lockfile |
Cache key includes:
- OS
- Architecture
- Node version
- Lockfile hash
Result: faster and more reliable CI runs.
Supports:
- npm registry
- GitHub Packages
- Custom registries
Automatically configures .npmrc.
Use custom mirror for faster downloads or internal networks.
| Feature | setup-node | Setup Node.js Pro |
|---|---|---|
| Auto detect package manager | β | β |
| Built-in install | β | β |
| Debug logs | β | β |
| Matrix-aware cache | β | |
| Version file support | β | |
| Mirror support | β | β |
- Monorepos (pnpm / yarn workspaces)
- Enterprise CI pipelines
- Multi-version testing
- Air-gapped environments (mirror support)
- Zero-config projects
If this project helps you, consider giving it a β
It helps others discover it.
PRs, issues, and suggestions are welcome.
MIT