reasonml / reason-cli

Globally installable Reason toolchain.
MIT License
290 stars 23 forks source link

Manual Steps to Run on Windows with reason-react #35

Open mattferrin opened 7 years ago

mattferrin commented 7 years ago

Compiler Missing

Install g++ compiler by selecting it as an option while using installer at http://www.mingw.org/

Add C:\MinGW\bin to your Path.

Non-Windows Unix Syntax

cd C:\ git clone https://github.com/reasonml/reason-cli.git

Change package.json line: "postinstall": "./scripts/performActualInstallAndFixLinks.sh" to "postinstall": ".\scripts\performActualInstallAndFixLinks.sh"

Possibly Unnecessary

Enable Bash and Developer Mode: https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

Install cd C:\ npm install -g ./reasonml

Check where ocamlmerlin refmt ocamlmerlin-reason

Test

npm install --save reason-react

Follow steps: https://github.com/chenglou/reason-react-example

Edit the simple example to not say hello, and open it's index.html file in Chrome.

chenglou commented 7 years ago

@mattferrin oh gosh we've totally missed this issue. To be clear, this works under 1.13.5 right? The latest 1.13.5 release gives prebuilt binaries and is a bit different

mattferrin commented 7 years ago

@chenglou I'm not using reason-react (and reason-cli) at present. I loved experimenting with them though. If someone else ran into the same issue, I wanted them to see this. I don't know if Windows works now. Someone else might know.

chenglou commented 7 years ago

Thanks for trying out reason-react! Yes, this did end up helping someone =)

jordwalke commented 7 years ago

I've verified that the latest Reason-cli dev branch works on cygwin without mingw, but have not yet tried cygwin with mingw. That is on my todo list as well. Thanks for reminding us.

Others have reported that Microsoft's new winbash works as well (but that's a whole other kind of approach to windows development).

fhelwanger commented 7 years ago

Are there any plans on making it work on windows without installing a unix-like environment?

chenglou commented 7 years ago

@fhelwanger in the future, yes. We'd love to have some contribution on this!

fhelwanger commented 7 years ago

Well, I did a workaround that worked surprisingly well 😁

I installed ocaml and reason via opam on windows bash. Then, I made some batch files that simple call:

bash -c <ocaml-binary> <parameters>

With that, I got even autocomplete in vscode to work.

It's very dirty at the moment, I'll try to turn it into a script or npm package that setup all this automatically later.

The files that I used are here: https://github.com/fhelwanger/ocaml-on-windows

chenglou commented 7 years ago

OK that's pretty crazy lol. @jordwalke would we be able to use that somewhat officially until things are cleaned up?

fhelwanger commented 7 years ago

I updated the repo. Now it's a npm package.

I'm really new to this ocaml and reason world, so feedback is very appreciated 😄

fhelwanger commented 7 years ago

Just tested on one machine without cygwin and the vscode-reasonml extension didn't work 😕

Already found why and opened this issue: https://github.com/freebroccolo/ocaml-language-server/issues/27