reasonml / reasonml.github.io

Reason's documentation site
https://reasonml.github.io
MIT License
334 stars 400 forks source link

Instructions on Getting Started with Windows #195

Open chenglou opened 7 years ago

chenglou commented 7 years ago

See the post below. If you have new findings, please comment. We'll then integrate your findings into the post and remove the comment to reduce noise. Thanks!

Edit: upon demand, I've cleaned up most of the outdated replies.

superherointj commented 7 years ago

Hello Windows user!

First. A very warm welcome. We're really glad you are here! We've been waiting for you! And I bring you good news:

Reason works 100% on Windows

screenshot

Workarounds

Solution 1: Ocaml/Reason on WSL (recommended)

Install Windows Subsystem for Linux (WSL)

Install Reason & Tools

Pick between Manual vs Automated option:

Option - Automated NPM Install for OPAM method

On WSL's Bash, Install BuckleScript globally

Configure Editor

Test It

Troubleshooting

superherointj commented 7 years ago

Ignore this post if you are a newcomer.

Follow first @superherointj post!

This is a development post for keeping notes, tracking issues to when time is due improve official user guide post above. It has been split to lower the noise.

Work In Progress - Current Status

Notes:

Solution: Windows Native without Merlin w/ BSB errors

How it would work

For now, solution for "Windows Native" isn't ready. Because:

Solution: Docker

Still on Research. Attempts:

To-Do

On Watch

If you know how to make this documentation better, reply here, shout at us or just fix it (if you can). Thanks in advance for helping us make this documentation better.

superherointj commented 6 years ago

Fundraiser for better Editor Support in Windows (Without WSL)

Join effort! :) https://github.com/facebook/reason/issues/1698

matystl commented 6 years ago

reference to npm install -g reason-cli@3.1.0-linux should be updated to npm install -g reason-cli@3.2.0-linux

robkuz commented 6 years ago

hey,

I am using Reason on Windows 10 (WSL) and I followed the instructions here - at least I think so but I get this error

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle demoapp@0.1.0~prestart: demoapp@0.1.0
6 info lifecycle demoapp@0.1.0~start: demoapp@0.1.0
7 verbose lifecycle demoapp@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle demoapp@0.1.0~start: PATH:...
9 verbose lifecycle demoapp@0.1.0~start: CWD: reason-test/demoapp
10 silly lifecycle demoapp@0.1.0~start: Args: [ '-c', 'bsb -make-world -w' ]
11 silly lifecycle demoapp@0.1.0~start: Returned: code: 2  signal: null
12 info lifecycle demoapp@0.1.0~start: Failed to exec start script
13 verbose stack Error: demoapp@0.1.0 start: `bsb -make-world -w`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid demoapp@0.1.0
15 verbose cwd /reason-test/demoapp
16 verbose Linux 4.4.0-17134-Microsoft
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "start"
18 verbose node v8.11.3
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 2
22 error demoapp@0.1.0 start: `bsb -make-world -w`
22 error Exit status 2
23 error Failed at the demoapp@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Intersting enough I have 2 other machines where this worked w/o problems. Does anybody see the error?

amsterdamharu commented 6 years ago

None of this seems to be needed for Windows.

Just tried on Windows 10:

yarn global add bs-platform
bsb -init my-react-app -theme react
cd my-react-app
yarn install
yarn start

In another command prompt:

yarn run webpack

In vscode pressed control+p and pasted the command: ext install jaredly.reason-vscode

Looks like it works as it should (did reload the vscode window after installing and setting Reason_language_server values in settings)

Jonas164 commented 5 years ago

ocaml 4.02.3 is severly outdated and I require ocaml 4.05 or greater. Is there a known solution to get merlin to work with WSL and VSCode with Ocaml >= 4.05 ? If yes, how? Simply switching to a newer ocaml version does not work.

robkuz commented 5 years ago

I got it running with installing X-Windows and running VSCode on WSL. However you better have a powerful machine. It ain't exactly fast

Jonas164 commented 5 years ago

That does not seem much better than just using a Unix-VM. Both, X-Windows and a VM are not enjoyable on my laptop though

emileber commented 4 years ago

@amsterdamharu as the project grows, jaredly.reason-vscode extension will eventually fail with "Command line is too long": https://github.com/jaredly/reason-language-server/issues/262