puter icon indicating copy to clipboard operation
puter copied to clipboard

fix: Make postinstall script work on Windows

Open AtkinsSJ opened this issue 1 year ago • 9 comments

Split each cd call into one per directory so that we don't have any directory separators, because separators are different on Windows than Mac/Linux.

This is intended to fix the issue in #362 but I'm waiting for confirmation on that.

AtkinsSJ avatar May 01 '24 09:05 AtkinsSJ

I replaced the line 30 as you said from: "postinstall": "cd packages/phoenix && cd packages/contextlink && npm install && cd - && cd packages/strataparse && npm install && cd - && cd packages/pty && npm install" to: "postinstall": "cd packages && cd phoenix && cd packages && cd contextlink && npm install && cd - && cd strataparse && npm install && cd - && cd pty && npm install"

but it seems it doesn't work. I've typed npm start and it says: image

Thank you a lot for the answer! ♥️

marco00petrucci avatar May 01 '24 09:05 marco00petrucci

Thanks for trying it out, did you run npm install after changing the line? I should have mentioned that.

AtkinsSJ avatar May 01 '24 19:05 AtkinsSJ

Yes, I made it: image

marco00petrucci avatar May 01 '24 19:05 marco00petrucci

Ah... I think cd - isn't a thing on Windows. I've changed it again, hopefully it'll work now. Can you try applying my changes here and then running npm install and npm start again?

AtkinsSJ avatar May 02 '24 10:05 AtkinsSJ

Now npm install worked. But if I make a npm start it says:

"export" is not recognized as an internal or external command, operable program or batch file

image

marco00petrucci avatar May 02 '24 10:05 marco00petrucci

Thanks again. Seems like making it work on Windows is going to be more work than I anticipated. :sweat_smile: Until then, you could try using the Docker build. Setting up Docker on Windows might not be straightforward depending on your system though. (Link)

AtkinsSJ avatar May 02 '24 10:05 AtkinsSJ

Thank you for now, I really appreciate your help. I already tried using Docker but it gives me an error: image Can you help me with it please? Thank again.

marco00petrucci avatar May 02 '24 10:05 marco00petrucci

Oh whoops, I forgot our instructions for that assume Linux. I don't actually use Docker so I can't help you unfortunately.

AtkinsSJ avatar May 02 '24 11:05 AtkinsSJ

Hey @AtkinsSJ not sure if it's related, but to get my postinstall scripts to work on windows for BrowserBox I needed to do this:

    "postinstall": "node exec.js \"./scripts/postinstall.sh\"",

Seems tricky at first, and looked like overkill to me when I first thought of it but worked really well and no more windows problems.

The issue is due to paths, and others have tripped over this with npm basically saying they will never fix this because people shouldn't be using windows or sth - that issue thread was a real doozy but I can't find it now haha 🤣

crisdosaygo avatar May 02 '24 12:05 crisdosaygo

No longer relevant, we don't have a postinstall script any more!

AtkinsSJ avatar Jun 27 '24 10:06 AtkinsSJ