Skip to content

Windows install fails: tar misinterprets C:\ path as remote host, supermodel.exe never extracted #133

@jonathanpopham

Description

@jonathanpopham

Summary

npm install -g @supermodeltools/cli fails on Windows on a clean machine (no prior install, cache empty). The postinstall script downloads the Windows zip, but tar treats the Windows path C:\Users\...\supermodel-extract-XXXXXX as a remote host spec (C: → hostname), so extraction silently produces no files. The subsequent copyFileSync then fails with ENOENT because supermodel.exe was never written to the temp dir.

Key line from the error:

tar: Cannot connect to C: resolve failed

This is GNU tar's rsh/remote-host behavior — any path with a colon before a slash is interpreted as host:path. On Windows, every absolute path hits this.

Reproduction

  1. Fresh Windows machine, no prior @supermodeltools/cli install.
  2. Node v22.13.1, npm 10.9.2 (nvm-noinstall).
  3. Run either:
    npm install -g @supermodeltools/cli
    npm install -g @supermodeltools/cli@0.6.5
    
  4. Both fail identically.

npm list @supermodeltools/cli confirms nothing was previously installed:

PS C:\Users\jonat> npm list @supermodeltools/cli
C:\Users\jonat
`-- (empty)

Environment

  • OS: Windows 11 Pro for Workstations (10.0.26100)
  • Shell: PowerShell; npm lifecycle invoked via C:\Program Files\Git\bin\bash.exe -c node install.js
  • Node: v22.13.1
  • npm: 10.9.2
  • Package version attempted: latest and 0.6.5 explicitly
  • Node install path: C:\Users\jonat\Downloads\nvm-noinstall\v22.13.1

Full error output

PS C:\Users\jonat> npm install -g @supermodeltools/cli@0.6.5
npm error code 1
npm error path C:\Users\jonat\Downloads\nvm-noinstall\v22.13.1\node_modules\@supermodeltools\cli
npm error command failed
npm error command C:\Program Files\Git\bin\bash.exe -c node install.js
npm error [supermodel] Downloading supermodel_Windows_amd64.zip from GitHub Releases...
npm error tar: Cannot connect to C: resolve failed
npm error node:fs:3086
npm error   binding.copyFile(
npm error           ^
npm error
npm error Error: ENOENT: no such file or directory, copyfile 'C:\Users\jonat\AppData\Local\Temp\supermodel-extract-BglSzM\supermodel.exe' -> 'C:\Users\jonat\Downloads\nvm-noinstall\v22.13.1\node_modules\@supermodeltools\cli\bin\supermodel.exe'
npm error     at Object.copyFileSync (node:fs:3086:11)
npm error     at WriteStream.<anonymous> (C:\Users\jonat\Downloads\nvm-noinstall\v22.13.1\node_modules\@supermodeltools\cli\install.js:86:12)
npm error     at WriteStream.emit (node:events:524:28)
npm error     at emitCloseNT (node:internal/streams/destroy:148:10)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:89:21) {
npm error   errno: -4058,
npm error   code: 'ENOENT',
npm error   syscall: 'copyfile',
npm error   path: 'C:\Users\jonat\AppData\Local\Temp\supermodel-extract-BglSzM\supermodel.exe',
npm error   dest: 'C:\Users\jonat\Downloads\nvm-noinstall\v22.13.1\node_modules\@supermodeltools\cli\bin\supermodel.exe'
npm error }
npm error
npm error Node.js v22.13.1
npm error A complete log of this run can be found in: C:\Users\jonat\AppData\Local\npm-cache\_logs\2026-04-15T17_21_55_563Z-debug-0.log

Probable root cause

install.js:86 is invoking tar to extract the Windows zip. On Windows, tar is being passed a path like -C C:\Users\...\supermodel-extract-XXXXXX, and GNU tar parses C: as host:path and tries to open an rsh connection. Extraction produces no file; the later copyFileSync(.../supermodel.exe, ...) then ENOENTs.

Options to fix:

  • Don't shell out to tar for a .zip — use a JS zip library (adm-zip, yauzl, etc.).
  • If keeping tar, pass --force-local, or cd into the directory and use a relative -C ., or use forward slashes only.
  • Detect extraction failure explicitly rather than proceeding to the copy step.

Notes

  • Reproduced by @jonathanpopham on 2026-04-15.
  • Originally reported by user Elm.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions