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.
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.
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.
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.
# 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.