Skip to content

Setup Node.js Pro Environment

Actions
Setup a Node.js environment with smart defaults, auto-detection, caching, and cross-platform support
V2
Latest
Star (2)

⚡ Setup NodeJS

image

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.


🚀 Why Setup Node.js Pro?

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.


⚡ Quick Start

- name: Setup Node.js
  uses: anantacloud-actions/setup-node@v1

🧩 Usage Examples

Use specific Node version

- uses: anantacloud-actions/setup-node@v1
  with:
    node-version: 20

Use version from file

- uses: anantacloud-actions/setup-node@v1
  with:
    node-version-file: .nvmrc

Enable caching

- uses: anantacloud-actions/setup-node@v1
  with:
    cache: npm

Configure private registry

- uses: anantacloud-actions/setup-node@v1
  with:
    registry-url: https://registry.npmjs.org
    token: ${{ secrets.NPM_TOKEN }}

Disable install step

- uses: anantacloud-actions/setup-node@v1
  with:
    install: false

🛠 Inputs

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

📤 Outputs

Name Description
node-version Installed Node.js version

🧠 Feature Breakdown

🔍 Version Resolution Priority

  1. node-version
  2. node-version-file
  3. Error if none provided

📦 Auto Package Manager Detection

File Found Manager
pnpm-lock.yaml pnpm
yarn.lock yarn
none npm

⚡ Built-in Install

Manager Command
npm npm ci
yarn yarn install --frozen-lockfile
pnpm pnpm install --frozen-lockfile

⚡ Matrix-Aware Caching

Cache key includes:

  • OS
  • Architecture
  • Node version
  • Lockfile hash

Result: faster and more reliable CI runs.


🌐 Registry Authentication

Supports:

  • npm registry
  • GitHub Packages
  • Custom registries

Automatically configures .npmrc.


🌍 Mirror Support

Use custom mirror for faster downloads or internal networks.


🔥 Comparison

Feature setup-node Setup Node.js Pro
Auto detect package manager
Built-in install
Debug logs
Matrix-aware cache ⚠️
Version file support ⚠️
Mirror support

🎯 Use Cases

  • Monorepos (pnpm / yarn workspaces)
  • Enterprise CI pipelines
  • Multi-version testing
  • Air-gapped environments (mirror support)
  • Zero-config projects

⭐ Support

If this project helps you, consider giving it a ⭐
It helps others discover it.


🧑‍💻 Contributing

PRs, issues, and suggestions are welcome.


📄 License

MIT

Setup Node.js Pro Environment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Setup a Node.js environment with smart defaults, auto-detection, caching, and cross-platform support
V2
Latest

Setup Node.js Pro Environment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.