spago icon indicating copy to clipboard operation
spago copied to clipboard

spago doesn't find purs on Windows

Open BLandorff opened this issue 2 years ago • 1 comments

I tried to install purescript and spago on Windows 10, node -v v16.15.1 , using npm i -g purescript and npm i -g spago, respectively. The purescript part is successful, and purs -version gives 0.15.4. The spago part seems to be successful, too, but a subsequent spago init results in

[info] Initializing a sample project or migrating an existing one..
[error] Failed to fetch purs version. Error was:
[error] Failed to run 'purs --version'

At first I suspected PowerShell to be the culprit, or running it from a console within WebStorm, but the results with cmd are the same, as well as running it as root (PowerShell or cmd), and/or with unsafe-perm=true, and/or without the -g. spago init -v or spago init -V does not return anything useful in this instance, either.

What am I doing wrong?

BLandorff avatar Aug 02 '22 15:08 BLandorff

Alright, I had a closer look. I'm almost certain that Turtle.Bytes.shellStrictWithErr https://github.com/purescript/spago/blob/310a7096b0d3e86f6464c667aa2339045d85d505/src/Spago/Cmd.hs#L14 returns ExitFailure when it should return ExitSuccess, most likely because it fails to correctly identify the OS. Unfortunately, I can't be sure because the above throws away the real error message, exit code and command output even with -v or -V, and I can't create a PR because spago doesn't work for me (I guess I could, but I'd be flying blind).

ZosoDerGoldene avatar Aug 03 '22 07:08 ZosoDerGoldene

Spago has been rewritten to PureScript, and should have a more reliable implementation for finding executables. So I'll close this for now, and let's open a new ticket if a similar problem manifests in the new version.

f-f avatar Sep 20 '23 17:09 f-f