Install a specific Node.js version for the job.
Section: Jobs, steps, and conditionals
Set up Node.js
yaml
yaml
- uses: actions/setup-node@v4
with:
node-version: 20Explanation
Use official setup actions for language runtimes whenever possible.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Jobs, steps, and conditionals
Test across multiple Node versions
Use a strategy matrix for version coverage.
Run on multiple operating systems
Validate portability across Linux, macOS, and Windows.