Open sanisoclem opened 2 years ago
Thanks for catching and reporting this, should be fixed by https://github.com/pluvial/node-zig/commit/1420aca29870eeb7045e5e2acedcc007cae59063
Do give it another go and let me know if it's failing anywhere else.
Hey, thanks for looking into this.
I've tried it again, but its failing when running tar
on the zip file. Log output:
npm install -g @ziglang/cli
npm ERR! code 1
npm ERR! path C:\ProgramData\nvm\v16.13.2\node_modules\@ziglang\cli
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node postinstall.js
npm ERR! $ which zig
npm ERR! /mnt/c/Program Files/nodejs/zig
npm ERR! $ zig version
npm ERR! Did not detect zig in system, will be installed locally
npm ERR! $ rm -rf $'C:\\ProgramData\\nvm\\v16.13.2\\node_modules\\@ziglang\\cli\\bin'
npm ERR! $ mkdir -p $'C:\\ProgramData\\nvm\\v16.13.2\\node_modules\\@ziglang\\cli\\bin'
npm ERR! $ curl -fsSL $'https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1301+cb3b1dd6d.zip' | tar xJ -C $'C:\\ProgramData\\nvm\\v16.13.2\\node_modules\\@ziglang\\cli\\bin' --strip-components=1
npm ERR! xz: (stdin): File format not recognized
npm ERR! tar: Child died with signal 13
npm ERR! tar: Error is not recoverable: exiting now
npm ERR! curl: (23) Failed writing body (2328 != 9260)
npm ERR! ProcessOutput {
npm ERR! stdout: '',
npm ERR! stderr: 'xz: (stdin): File format not recognized\n' +
npm ERR! 'tar: Child died with signal 13\n' +
npm ERR! 'tar: Error is not recoverable: exiting now\n' +
npm ERR! 'curl: (23) Failed writing body (2328 != 9260)\n',
npm ERR! signal: null,
npm ERR! exitCode: 2 (Misuse of shell builtins)
npm ERR! }
...
I should also add that It works perfectly in WSL so there is a workaround in windows.
You're right, this needs a more thorough rework to work well on Windows... As you mentioned it should work well within WSL, that's where I originally developed it 😅 But I'm not sure what the idiomatic way to do this kind of thing in Windows, might make sense to do the fetching + unzipping within node.js itself, or otherwise replace the Unixy calls with the CMD equivalent.
Hey folks, I opened #2 which should fix this problem. I'll appreciate it if you took a look 🙌
Installation fails on windows because the download url is incorrect (
.tar.xz
instead of.zip
):Expected: https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1261+6f986298c.zip source Actual: https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.1030+90059a12e.tar.xz -> returns HTTP 403