isNpmFromWindowsPath function

bool isNpmFromWindowsPath()

Checks if the npm executable is from the Windows filesystem in WSL.

Implementation

bool isNpmFromWindowsPath() {
  if (!isWslEnvironment()) return false;
  try {
    final result = Process.runSync('which', ['npm']);
    final path = (result.stdout as String).trim();
    return path.startsWith('/mnt/c/');
  } catch (_) {
    return false;
  }
}