reason-cli icon indicating copy to clipboard operation
reason-cli copied to clipboard

Manual Steps to Run on Windows with reason-react

Open mattferrin opened this issue 8 years ago • 10 comments

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.

mattferrin avatar Jun 12 '17 19:06 mattferrin

@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

chenglou avatar Jul 22 '17 23:07 chenglou

@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.

mattferrin avatar Jul 22 '17 23:07 mattferrin

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

chenglou avatar Jul 23 '17 00:07 chenglou

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).

jordwalke avatar Jul 26 '17 01:07 jordwalke

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

fhelwanger avatar Jul 31 '17 19:07 fhelwanger

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

chenglou avatar Aug 01 '17 07:08 chenglou

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

fhelwanger avatar Aug 02 '17 16:08 fhelwanger

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

chenglou avatar Aug 02 '17 21:08 chenglou

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 avatar Aug 02 '17 23:08 fhelwanger

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

fhelwanger avatar Aug 03 '17 00:08 fhelwanger