puter
puter copied to clipboard
fix: Make postinstall script work on Windows
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.
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:
Thank you a lot for the answer! ♥️
Thanks for trying it out, did you run npm install after changing the line? I should have mentioned that.
Yes, I made it:
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?
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
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)
Thank you for now, I really appreciate your help.
I already tried using Docker but it gives me an error:
Can you help me with it please? Thank again.
Oh whoops, I forgot our instructions for that assume Linux. I don't actually use Docker so I can't help you unfortunately.
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 🤣
No longer relevant, we don't have a postinstall script any more!