ac4af582301a4e8a29245dbba767eba31334ddf9
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5b4da5bee3 |
proc: magpie on Windows finds fnm's node and npx (#2685)
What changed
- fnm puts its Node on a terminal's PATH from the shell profile
(`fnm env | Invoke-Expression`), never in the registry, so magpie
started from the Start menu had no node: a Library MCP server run by
bare npx was "notfound", and one run by npx.cmd's full path (the
reporter's C:\Users\...\fnm\aliases\default\npx.cmd, alone or under
`cmd /c`) exited 1 with cmd's "'node' is not recognized", since the
package npx fetched runs node by name.
- Windows UserPath (no-op before) adds the folder fnm's default alias
names, after what PATH has. UserBinDirs (FindTool) gets each fnm
Node: the default alias first, then installations newest by number.
- fnm's Windows layout, checked against Schniz/fnm master (config.rs,
directories.rs, version.rs, fs.rs, commands/env.rs): root FNM_DIR,
else etcetera's Windows data_dir\fnm (home\AppData\Roaming, APPDATA),
else legacy ~\.fnm; versions in node-versions\<v>\installation with
node.exe/npx.cmd directly in it (no bin on Windows); aliases\default
a junction to an installation folder; the "system" alias points at
Z:\_fnm_\..., read as none. XDG vars on Windows only move fnm's
multishell links, not its versions. LOCALAPPDATA isn't used for them.
- The shared node-version helpers (nodeVersions, parseNodeVersion,
nodeVersionLess, isDir) and addPath moved from the !windows files to
nodever.go unchanged; fnmWin* there take home/APPDATA/FNM_DIR as
arguments so the tests run them on every OS.
- The Library check (checkStdioAt, this machine only) starts a bare
command PATH lacks from where proc.FindTool finds it and puts that
folder on the child's PATH (stdioProgram, withPath), as the owner's
plan on the issue said. Docs: agent-wiring.md, library.md.
Run
- macOS: go test -count=1 ./internal/proc/ ./internal/library/ ok
(TestNoCommandBypassesProc and the other proc guards included);
gofmt -l clean; go vet GOOS=windows/darwin for proc, library, cli,
daemon; GOOS=linux vet proc, library and (-tags nogui) cli, daemon;
GOOS=windows test binaries for proc and library build.
- Windows box (Win 11 x64), cross-compiled amd64 test binaries:
TestUserPathFnmNode (real junction via mklink /J, npx.cmd that runs
node by name) red on origin/main 4a1cd7765's code ("PATH after
UserPath = [C:\windows\System32], want fnm's default alias"), green
here; TestFnmWin* green.
- Real fnm 1.39.0 + Node v24.22.1 installed into a sandbox
(USERPROFILE/APPDATA under C:\Users\yeton\fnm-2685, no FNM_DIR,
registry PATH without node). A throwaway probe calling UserPath then
library.CheckServer on chrome-devtools-mcp@latest:
|