You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: session-start-profiler falsely reports "Vercel CLI is not installed" (runs the bash launcher without a shell) #105
On Windows, the SessionStart hook (hooks/session-start-profiler.mjs → checkVercelCli()) reports "The Vercel CLI is not installed" on every session start, even when the CLI is installed globally and on PATH (vercel --version → 52.0.0).
Environment
OS: Windows 11
Node: v24.14.1, npm 11.11.0
Vercel CLI: 52.0.0, global install at C:\Users\<user>\AppData\Roaming\npm\ (contains vercel, vercel.cmd, vercel.ps1)
resolveBinaryFromPath("vercel") builds candidate names as ["", ".EXE", ".CMD", ...] — bare name first (getBinaryPathCandidates, the ["", ...WINDOWS_EXECUTABLE_EXTENSIONS] order). So on Windows it returns the extensionless…\npm\vercel (the Unix shell launcher npm also drops in the bin dir) beforevercel.cmd. checkVercelCli() then runs it with no shell:
execFileSync without a shell cannot execute a shell script (nor a .cmd) on Windows → throws ENOENT → the catch returns { installed: false } → the hook emits the false "not installed" message.
Minimal reproduction
const{ execFileSync }=require("node:child_process");constbin=process.env.APPDATA+"\\npm\\vercel";// the extensionless launcher resolveBinaryFromPath returnsexecFileSync(bin,["--version"]);// THROWS ENOENTexecFileSync(bin,["--version"],{shell: true});// OK -> 52.0.0
Proposed fix
Run the version check (and ideally the npm view check) through a shell on Windows:
(Heads-up: shell: true + an args array triggers Node's DEP0190. It's harmless here since the args are a fixed --version, but if you'd rather avoid the warning you can build a single command string, or alternatively prefer the PATHEXT-extension candidates over the bare name on Windows and shell-out for .cmd.)
Confirming this still reproduces, and adding a second symptom from the same code path.
Still present in 0.45.1 (this issue reports 0.40.0 / 0.43.0), Node v24.14.0, Windows 11, Vercel CLI 57.0.0 installed globally at C:\Users\<user>\AppData\Roaming\npm\.
Running resolveBinaryFromPath + checkVercelCli verbatim against the real process PATH:
platform : win32
node : v24.14.0
RESOLVED TO : C:\Users\<user>\AppData\Roaming\npm\vercel
execFileSync FAILED after 2 ms
code : ENOENT
message: spawnSync C:\Users\<user>\AppData\Roaming\npm\vercel ENOENT
=> would report NOT INSTALLED
CONTROL: "...\npm\vercel.cmd" with shell:true => "57.0.0"
Exactly the diagnosis above: the bare name is tried before the PATHEXT variants, and accessSync(path, X_OK) on Windows doesn't distinguish executables, so the extensionless Unix launcher wins over vercel.cmd.
New: the same path also breaks npm detection, which I don't think has been reported.
npm -> C:\Program Files\nodejs\npm | spawn FAILED (ENOENT) -> reported as NOT INSTALLED
vercel -> C:\Users\<user>\AppData\Roaming\npm\vercel | spawn FAILED (ENOENT) -> reported as NOT INSTALLED
checkVercelCli() calls resolveBinaryFromPath("npm") for the npm view vercel version update check, and npm has the same extensionless-launcher-plus-.cmd layout. So on Windows that branch can never succeed either — the CLI update check silently never runs, independently of the "not installed" message. Anyone who fixes only the vercel call will still leave the update check dead.
That makes the candidate-ordering fix (prefer PATHEXT extensions over the bare name on win32) preferable to shelling out only in checkVercelCli, since it repairs both call sites at once.
Activity
shivakrishnakokkula commentedon Jul 29, 2026
Confirming this still reproduces, and adding a second symptom from the same code path.
Still present in
0.45.1(this issue reports 0.40.0 / 0.43.0), Node v24.14.0, Windows 11, Vercel CLI 57.0.0 installed globally atC:\Users\<user>\AppData\Roaming\npm\.Running
resolveBinaryFromPath+checkVercelCliverbatim against the real processPATH:Exactly the diagnosis above: the bare name is tried before the
PATHEXTvariants, andaccessSync(path, X_OK)on Windows doesn't distinguish executables, so the extensionless Unix launcher wins oververcel.cmd.New: the same path also breaks
npmdetection, which I don't think has been reported.checkVercelCli()callsresolveBinaryFromPath("npm")for thenpm view vercel versionupdate check, andnpmhas the same extensionless-launcher-plus-.cmdlayout. So on Windows that branch can never succeed either — the CLI update check silently never runs, independently of the "not installed" message. Anyone who fixes only thevercelcall will still leave the update check dead.That makes the candidate-ordering fix (prefer
PATHEXTextensions over the bare name onwin32) preferable to shelling out only incheckVercelCli, since it repairs both call sites at once.