Bug report: spfx doctor reports missing gulp
Description
I don't know when the official guidance changed, but gulp is no longer required or recommended as a -global package for SPFx. doctor check should check for gulp-cli instead. If gulp is installed, recommend that it be uninstalled and gulp-cli be installed instead.
Steps to reproduce
Run the following from any command prompt:
m365 spfx doctor
Expected results
If gulp is not present, the "x gulp not found" message should not appear.
If gulp is present, recommendation to remove gulp and install gulp-cli should be included.
If gulp-cli is not present, a "x gulp-cli not found" message should appear and instructions on how to install included.
If gulp is present, check for the correct version of gulp-cli and report result.
Actual results
With the following environment:

when "m365 spfx doctor" is executed, the following is the output:

Diagnostics
Executing command spfx doctor with options {"options":{"debug":true}}
CLI for Microsoft 365 SharePoint Framework doctor Verifying configuration of your system for working with the SharePoint Framework
Detecting SharePoint Framework version based on @microsoft/sp-core-library local... Executing npm: ls @microsoft/sp-core-library --depth=0 --json... Found @microsoft/[email protected] ✔ SharePoint Framework v1.15.0 ✔ Node v16.16.0 Executing npm: ls yo --depth=0 --json -g... ✔ yo v4.3.0 Executing npm: ls gulp --depth=0 --json -g... ✖ gulp not found Executing npm: ls typescript --depth=0 --json... ✔ bundled typescript used
Recommended fixes:
- npm i -g gulp@4
CLI for Microsoft 365 version
v5.5.0
nodejs version
16.16.0
Operating system (environment)
Linux
Shell
bash
cli doctor
{ "os": { "platform": "linux", "version": "#1 SMP Wed Mar 2 00:30:59 UTC 2022", "release": "5.10.102.1-microsoft-standard-WSL2" }, "cliVersion": "5.5.0", "nodeVersion": "v16.16.0", "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e", "cliAadAppTenant": "common", "authMode": "DeviceCode", "cliEnvironment": "", "cliConfig": {}, "roles": [], "scopes": [ "AllSites.FullControl", "AppCatalog.ReadWrite.All", "ChannelMember.ReadWrite.All", "ChannelMessage.Read.All", "ChannelMessage.Send", "ChannelSettings.ReadWrite.All", "Directory.AccessAsUser.All", "Directory.ReadWrite.All", "Group.ReadWrite.All", "IdentityProvider.ReadWrite.All", "Mail.ReadWrite", "Mail.Send", "Policy.Read.All", "Reports.Read.All", "Tasks.ReadWrite", "Team.Create", "TeamMember.ReadWrite.All", "TeamsApp.ReadWrite.All", "TeamsAppInstallation.ReadWriteForUser", "TeamSettings.ReadWrite.All", "TeamsTab.ReadWrite.All", "TermStore.ReadWrite.All", "User.Invite.All", "User.ReadWrite.All", "profile", "openid", "email" ] }
Additional Info
No response
I would love to work on this change, but need some guidance. I have reviewed the code and understand what it is currently doing, but not how to swap out gulp for gulp-cli.
Thanks for bringing this up, @DonKirkham. Moving to gulp-cli is a long awaited change I guess.
Maybe @rabwill or @waldekmastykarz can give you a hand here.
I have forked and reviewed the cli-microsoft365 project. I would welcome someone to walk me through the code around SPFx Doctor to make sure I understand it before I start making changes. I am in US Central Tiem Zone, but am up early, so could meet at a reasonable time for Europeans. @rabwill @waldekmastykarz @garrytrinder
We're checking the version of gulp here: https://github.com/pnp/cli-microsoft365/blob/8be35f8e6bdd61842a7e60df56697789836339b9/src/m365/spfx/commands/spfx-doctor.ts#L591-L603. At minimum, we'd need to replace gulp with gulp-cli in lines 593 and 596. Ideally, we'd make it clearer and replace all occurrences of gulp with gulp-cli or gulpCli, where it's used as a property/variable name.