I recently installed Opam, OCaml, and Merlin on my WSL (Ubuntu) with the intention of writing OCaml code in Atom. On Atom, I installed the ocaml-merlin package and all of its requisite Atom packages. When editing my OCaml file in Atom however, I keep getting an error that says [Linter] Error running OCaml Merlin
, and opening the console displays these errors:
Merlin process started, pid = undefined
C:\Users\Ro\.atom\packages\ocaml-merlin\lib\merlin.coffee:38 Error: spawn ocamlmerlin ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232)
at onErrorNT (internal/child_process.js:407)
at process._tickCallback (internal/process/next_tick.js:63)
2internal/stream_base_commons.js:78 Uncaught (in promise) Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:78)
at writeGeneric (internal/stream_base_commons.js:73)
at Socket._writeGeneric (net.js:713)
at Socket._write (net.js:725)
at doWrite (_stream_writable.js:410)
at writeOrBuffer (_stream_writable.js:394)
at Socket.Writable.write (_stream_writable.js:294)
at Interface._writeToOutput (readline.js:300)
at Interface.prompt (readline.js:264)
at Interface.question (readline.js:277)
at /C:/Users/Ro/.atom/packages/ocaml-merlin/lib/merlin.coffee:42
at new Promise (<anonymous>)
at /C:/Users/Ro/.atom/packages/ocaml-merlin/lib/merlin.coffee:40
C:\Users\Ro\.atom\packages\linter\lib\linter-registry.js:154 [Linter] Error running OCaml Merlin Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:78)
at writeGeneric (internal/stream_base_commons.js:73)
at Socket._writeGeneric (net.js:713)
at Socket._write (net.js:725)
at doWrite (_stream_writable.js:410)
at writeOrBuffer (_stream_writable.js:394)
at Socket.Writable.write (_stream_writable.js:294)
at Interface._writeToOutput (readline.js:300)
at Interface.prompt (readline.js:264)
at Interface.question (readline.js:277)
at /C:/Users/Ro/.atom/packages/ocaml-merlin/lib/merlin.coffee:42
at new Promise (<anonymous>)
at /C:/Users/Ro/.atom/packages/ocaml-merlin/lib/merlin.coffee:40
I definitely have Merlin installed, and issuing which ocamlmerlin
on the WSL terminal returns /home/ro/.opam/4.09.0/bin/ocamlmerlin
, so I believe this means that it’s on the PATH already?
If it’s relevant, my OCaml version is 4.09.0
and my Merlin version is 73e9771b, for Ocaml 4.09.0
.
After many hours of poking around the internet for a solution, I saw that a possible issue could be that I don’t have a .merlin file at the root of my directory. I’m not sure how to confirm this is the issue or how to remedy it if that is the case. I’ve also seen that Dune creates an .merlin file for you, but I’m not using Dune (although I believe I have it installed). Calling the OCaml compiler directly in lieu of using Dune has been working just fine for me, so I don’t particularly care to start using Dune.
If any of you know what the issue could be and how to fix it, I would greatly appreciate any help. Thank you