Skip to content

SPFx Doctor always produces "Error: npm not found" #2299

@hugoabernier

Description

@hugoabernier

Description

I was getting more and more people reporting this issue when they were trying to resolve their issues with SPFx projects and always assumed it was their environment, but now I'm able to reproduce the issue consistently.

When running SPFx doctor within a solution folder or at the "global" level, the results are invariably:

CLI for Microsoft 365 SharePoint Framework doctor
Verifying configuration of your system for working with the SharePoint Framework


Error: npm not found

Steps to reproduce

  1. From within a solution folder, run m365 spfx doctor
  2. Get the error message
  3. From outside a solution folder, run the same command
  4. Get the error message
  5. Running npm -v immediately after the error message returns the npm version, as expected.

Expected result

Should get a report on the solution or the environment.

Actual result

Get Error: npm not found

Environment

  • node 8x, 10x, 12x
  • m365 cli v.3.7.0

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions