Try checking the locations of ninja with where
from cmd.exe, if you find something other than an executeble file (like ninja.bat, ninja.py, etc.), remove their locations from Path. See https://stackoverflow.com/a/79528495/11484080 for the explanation.