NodeJS version does not meet requirements – Gulp serve error

NodeJS version does not meet requirements error while running gulp serve command. If gulp serve just failed with a Node version warning, you’re not alone. SPFx toolchains only support specific Node.js ranges. If your machine is on a newer major release (e.g., v22.x), the build refuses to run. Good news: you don’t need to reinstall everything—just switch to a supported Node version, reinstall dependencies, and rebuild. The exact gulp serve error as below :

Advertisements
PS C:\SPFX\gulp serve
Error: Your dev environment is running NodeJS version v22.19.0 which does not meet the requirements for running this tool. This tool requires a version of NodeJS that matches >=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0 || >=18.17.1 <19.0.0 || >=20.11.0 <21.0.0
    at SPWebBuildRig.initialize (C:\SPFX\node_modules\@microsoft\sp-build-web\lib\SPBuildRig.js:50:19)
    at Object.initialize (C:\SPFX\node_modules\@microsoft\sp-build-web\lib\index.js:35:17)
    at Object.<anonymous> (C:\SPFX\gulpfile.js:16:7)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Module.require (node:internal/modules/cjs/loader:1463:12)
Advertisements

Why this happens

Your Node.js version (v22.19.0 in this case) is outside the ranges the SPFx tooling supports. The guard prevents cryptic build failures later in the process.

Install and switch NodeJ version

Follow the command below to install specific nodejs version.

nvm install 20.19.5
nvm use 20.19.5
Advertisements

Clean and reinstall SPFX dependencies

Follow the command below to clean spfx dependencies and reinstall spfx dependencies.

Remove-Item -LiteralPath .\node_modules -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -LiteralPath .\package-lock.json -Force -ErrorAction SilentlyContinue
npm cache clean --force
npm install
Advertisements

Rebuild and run gulp serve

Follow the below commands to clean, build, trust certificate and serve again.

gulp clean
gulp build
gulp trust-dev-cert
gulp serve

Now the issue NodeJS version does not meet requirements should be resolved.

Advertisements
Which Node versions are acceptable for this SPFx toolchain ?

From the error message, any of:
=12.13.0 <13.0.0 · >=14.15.0 <15.0.0 · >=16.13.0 <17.0.0 · >=18.17.1 <19.0.0 · >=20.11.0 <21.0.0.

Why not use Node 22.x ?

SPFx tooling typically lags the latest Node majors. A newer runtime can break gulp tasks and native dependency builds.

Do I need to reinstall global CLIs after switching Node ?

Often yes—each Node version has its own global tool set (npm i -g ).

Can winget fix this by itself ?

winget can install a specific Node, but nvm/nvm-windows is the best way to switch versions per project.

Windows Package Manager winget — Complete Guide : Install, Upgrade & Automate

winget is Microsoft’s official command-line package manager for Windows. Instead of hunting for installers on websites and clicking through wizards, you can search, install, upgrade, and remove apps with a single command. It’s fast, script-friendly, and perfect for keeping development and productivity tools consistent across machines.

Advertisements

What is winget ?

Windows Package Manager (the tool is called winget) brings package management to Windows in a way that will feel familiar if you’ve used Linux’s apt or macOS’s brew. It pulls software from multiple sources—like the Windows Package Manager Community Repository and the Microsoft Store—and exposes a unified, predictable command set.

  • Simplified installs: One command replaces manual downloads and click-through installers.
  • Version control: Install a specific version or safely upgrade later.
  • Multiple sources: Community repository, Microsoft Store, and any additional repositories you configure.
  • Automation-ready: Silent installs, easy scripting, and export/import of app lists.
  • Consistency: Manage classic desktop apps and Store apps from one CLI.
Advertisements

Prerequisites quick check

winget ships with modern Windows via the “App Installer” package. To confirm it’s available:

winget --version

If the command isn’t recognized, install/update App Installer from the Microsoft Store, then reopen your terminal.

Advertisements

winget Basics: Everyday Commands You’ll Actually Use

winget is the Windows Package Manager. These core commands cover 90% of daily app management—discover, install, update, and remove—without opening a browser.

Check your installation

winget --version

Confirms that Windows Package Manager is installed (via “App Installer”). If it’s not recognized, install/update App Installer from Microsoft Store, then reopen your terminal.

Search for apps

Finds matching packages across configured sources (Community repository, Microsoft Store, etc.). Use quotes for multi-word names.

winget search <package-name> # Example: winget search "Visual Studio Code"
Advertisements

Inspect details before installing

winget show <package-id> # Example: winget show Microsoft.VisualStudioCode

Shows the exact Id, available versions, installer types (EXE/MSI/MSIX), and silent switches. Use the Id for reliable installs.

Install an app

winget install <package-id> # Example: winget install Git.Git

Installs the latest version from your sources. To pin a version: –version 2.44.0. For automation, add –silent –accept-package-agreements –accept-source-agreements.

List installed apps (known to winget)

winget list

Displays packages winget can see and manage. Some older apps may not appear if they weren’t installed through recognized channels.

Advertisements

Upgrade software

# Upgrade everything with updates available winget upgrade --all
winget upgrade Git.Git

Keep your toolbox current. If an app is running, close it first to avoid upgrade failures.

Uninstall an app

winget uninstall <package-id> # Example: winget uninstall Microsoft.VisualStudioCode

Removes the selected package using its registered uninstaller. If multiple entries exist, specify the exact Id from winget list.

Advertisements

Pro Tips

  • Prefer Ids over names: Git.Git beats “Git for Windows” for accuracy.
  • Script it: Use –silent and the two –accept-* flags in CI or setup scripts.
  • Speed up new PC setup: Export your stack once, then import on fresh machines:
winget export --output .\apps.json winget import --import-file .\apps.json --accept-package-agreements --accept-source-agreements
  • Know your sources: winget source list shows where packages come from (Community repository, Microsoft Store, etc.).

Bottom line: With these commands, you can install, audit, update, and remove most apps on Windows—no download pages required.

Advertisements

winget Advanced: Version Pinning, Silent Installs, Sources & Settings

Once you’re comfortable with the basics, these four commands unlock repeatable, script-friendly installs and tighter control over where packages come from and how they’re configured.

Install a specific version

Use –version when you need an exact build for compatibility or CI reproducibility.

winget install <package-id> --version <version> # Examples winget install OpenJS.NodeJS.LTS --version 20.19.0 winget install Git.Git --version 2.44.0
  • When to pin: legacy projects, matching team environments, or verifying a bug against a known version.
  • Tip: get the valid versions list with winget show.

Run silent, unattended installs

For scripts and automated setups, silence prompts so the install completes without interaction.

winget install <package-id> --silent --accept-package-agreements --accept-source-agreements # Example winget install Microsoft.VisualStudioCode --silent --accept-package-agreements --accept-source-agreements
  • Note: not every installer supports fully silent switches; check winget show to see installer type (EXE/MSI/MSIX) and behavior.
  • Admin rights: some packages elevate automatically; if it fails, run your terminal as Administrator.
Advertisements

See (and trust) your sources

Know where packages originate and keep repositories healthy.

winget source list # Common outputs: # winget <Windows Package Manager Community Repository> # msstore <Microsoft Store>
  • Update / reset sources:
winget source update winget source reset --force

Why it matters: clear provenance reduces surprises (e.g., Store vs Community repository), especially in enterprises.

Advertisements

Open and edit winget settings (JSON)

Customize defaults—great for teams and repeatable builds.

winget settings

That opens a JSON file. Here’s a minimal example you can adapt:

{ "$schema": "https://aka.ms/winget-settings.schema.json", "installBehavior": { "preferences": { "scope": "machine", // "user" or "machine" "locale": "en-US" }, "skipDependencies": false, "disableInstallNotes": true }, "network": { "downloader": "default" // or "WinINet", "DeliveryOptimization" }, "telemetry": { "disable": false }, "visual": { "progressBar": "rainbow" // "accent", "retro", etc. } }

Putting it all together (script-ready examples)

Pin and install a toolchain silently:

winget install Git.Git --version 2.44.0 --silent --accept-package-agreements --accept-source-agreements winget install Microsoft.VisualStudioCode --version 1.93.0 --silent --accept-package-agreements --accept-source-agreements winget install CoreyButler.NVMforWindows --silent --accept-package-agreements --accept-source-agreements

Export and re-create your stack on a new PC:

# On your primary machine winget export --output .\my-dev-stack.json
Advertisements

Install NVM for Windows and Pin a Specific Node.js Version with winget

The fastest way to manage Node.js on Windows is to combine two tools: winget (Microsoft’s package manager) to install software, and NVM for Windows (Node Version Manager) to keep multiple Node versions and switch between them on demand. Below is a practical, copy-ready flow you can run in PowerShell.

Discover and inspect the NVM package

First, confirm that winget can find the package and show its details (ID, available versions, installer type, etc.).

winget search nvm # Find Node Version Manager (NVM)Windows
winget show CoreyButler.NVMforWindows # Inspect the exact package (recommended: use the Id for installs)
Advertisements

Install NVM for Windows via winget

Use winget to install NVM silently and accept license prompts (handy for automation). If you’d rather click through an installer, omit the flags.

winget install CoreyButler.NVMforWindows --silent ^ --accept-package-agreements --accept-source-agreements

When the install finishes, open a new PowerShell window so your PATH changes take effect.

Install a specific Node.js version with winget

winget can install Node directly, including a pinned version. This is useful if you simply want one fixed Node version (no switching).

winget install OpenJS.NodeJS --version 22.19.0 # Example: install a specific Node.js version