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.

Backup restore site collection sharepoint

Backup restore site collection sharepoint is the mostly requested task for administrator. As an admin, you should know how to backup sharepoint site collection. When you need to migrate site collection from one environemnt to another environent Example Production to QA mostly, we follow the sharepoint back up restore method. It can be sharepoint content database backup restore method or only backup and restore site using powershell method.

Advertisements

sharepoint backup and restore site collection methods

There are different ways to back up site in sharepoint and restore to different infracture. We can follow content database back up and restore method. Follow the post below on the same.

https://atomic-temporary-119393429.wpcomstaging.com/dismount-mount-content-database-in-sharepoint-2019-using-powershell/

we can follow any one of the backup and restore methods in sharepoint, find below:

  • Backup site collection using central admin.
  • Backup site collection using powershell
  • Restore site collection using powershell
Advertisements

Backup site using central admin

Follow the step by step procedure to back sharepoint site using central admin method below:

  • Open “SharePoint Central Administration”
  • Click on “Backup and Restore” from left navigation.
  • Click on “Perform a site collection backup” present under “Granular Backup”.
  • Select “Site Collection” and enter backup file save path.
  • Select the check box “Overwrite existing file” so as to save and replace the existing file with same name.
  • proceed for click “Start Backup”.
Backup site collection using central admin
Advertisements
  • Backup process will start with message “A site collection backup is currently in progress” under “Granular Backup Job Status” page. You will see page as shown below.
Granular Backup Job Status
Advertisements
  • Click on “Refresh” to check the status in certain interval of time. You will see the completion status once done.
Granular Backup Job Status completed
Advertisements

Backup site using powershell

You can follow powershell command which comes under sharepoint backup and restore best practices. Follow the step by step procedure below:

  • Run “SharePoint 2019 Management Shell” as an Administrator.
  • Run the command “Backup-SPSite” as shown in code below.
Backup-SPSite http://win-q2repghf9du/sites/DevSite -Path "C:\backup\SharePoint\DevSite.bak" -Verbose
Advertisements

Restore site collection using powershell

Follow step by step procedure to restore site using powershell.

Identify the content database and respective DB server in which you are planning to restore by navigating “Manage Content Database -> Select web application -> Click on respective content database”.

attach content databases in web application sharepoint
manage content database settings
Advertisements
  • Run “SharePoint 2019 Management Shell” as an Administrator.
  • Run the command “Restore-SPSite” as shown in code below.
Restore-SPSite -Identity http://win-q2repghf9du:44179/ -Path C:\backup\SharePoint\DevSite.bak -DatabaseServer WIN-Q2REPGHF9DU -DatabaseName WSS_Content_WebApp -Force -Verbose
Advertisements

if you are passing url http://win-q2repghf9du:44179/, restored site collection will be a root site collection, as below.

restored root site collection sharepoint
Advertisements

if you are passing url http://win-q2repghf9du:27315/sites/DevSite, restored site collection will be created with same url, as below. This URL is the new site collection url as restored path.

Restore-SPSite -Identity http://win-q2repghf9du:27315/sites/DevSite -Path C:\backup\SharePoint\DevSite.bak -DatabaseServer WIN-Q2REPGHF9DU -DatabaseName WSS_Content_41dfb81a085a49b781b289e61fc4b037 -Force -Verbose
Advertisements
restore site collection in sharepoint
restoring site collection in sharepoint using powershell

Backup sharepoint online site collection

So as to take backup sharepoint online site collection, you need to contact microsoft support by creating a ticket.

Advertisements
Advertisements

Delete SharePoint site subsite permanently

Delete SharePoint site subsite on premise environment is a common task for administrator. You might be thinking how to permanently delete a SharePoint site collection in production server. There are difference scenarios, you might face while trying to delete a site SharePoint. After sharepoint site migration, we need to delete old site, exactly where its helpful, as per current situation.

Advertisements

Permanently delete a subsite in SharePoint from site settings

You can follow UI method for sharepoint subsite deletion following step by step procedure below.

  • Navigate to sharepoint subsite.
  • Open site settings.
  • Click on Delete this site present under Site Actions.
Delete SharePoint subsite from site settings
Advertisements
  • Click on Delete option present at bottom right.
  • Pop up will appear for confirmation.
  • Click on OK to delete.
delete this site in site settings
Advertisements

Permanently delete a site in SharePoint from site settings

Follow the same procedure to delete site collection as well. Navigate to site collection settings and click on delete this site. After that click on delete and OK to apply the change.

Same steps are also applicable to delete sharepoint online site in office 365.

Advertisements

Delete a Site Collection from Central Admin

You can follow another way to delete site collection from central admin without navigating to site settings.

  • Navigate to central admin
  • Click on Application Management.
  • Click on Delete a site collection present under option Site Collections.
delete a site collection in sharepoint from central admin
Advertisements
  • Select site collection from any one web application, from the drop down, that you want to delete and click on Delete.
  • Click on OK for confirmation to apply changes.
delete site collection
Advertisements

Delete SharePoint site collection powershell

Follow Remove-SPSite, the powershell command to delete site collection in SharePoint.

Remove-SPSite -Identity "<Site Collection Url>" -GradualDelete -Confirm:$False
Remove-SPSite -Identity "http://win-q2repghf9du:44179/sites/SharePointTech" -GradualDelete -Confirm:$False
Remove-SPSite
Advertisements

Delete SharePoint subsite powershell

If you need to delete SharePoint subsite using powershell command, follow Remove-SPWeb.

Remove-SPWeb -Identity "<Subsite Url>"
Remove-SPWeb -Identity "http://win-q2repghf9du:44179/sites/SharePointTechnicalSupport/Subsite1/"
Remove-SPWeb
Advertisements

Delete all site collections present under web application

If you want to delete all site collections present under one web application, follow the command below.

$WebApplicationURL="http://win-q2repghf9du:24072/"
Get-SPWebApplication $WebApplicationURL | Get-SPSite -Limit ALL | Remove-SPSite -Confirm:$false
Delete all site collections present under web application
Advertisements

Delete all site collections present under specific managed path

Specific requirement might come when user need to delete all site collections part of one specific sharepoint managed path, in a web application, using powershell.

Get-SPSite "<web application url>/<managed path>*" -Limit ALL | Remove-SPSite -Confirm:$false
Get-SPSite "http://win-q2repghf9du:27315/sites*" -Limit ALL | Remove-SPSite -Confirm:$false
Delete all site collections present under specific managed path
Advertisements
Advertisements

Similar Article

Advertisements