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

Homebrew's OCaml symlink overwritten after installing

Open persianturtle opened this issue 8 years ago • 5 comments

Executing npm install -g git://github.com/reasonml/reason-cli.git#beta-v-1.13.5 overwrote homebrew's OCaml symlink.

Before executing the installation, ocaml -version was 4.04.1 and afterwards it was 4.02.3.

I had to re-link the package in brew with:

brew unlink ocaml && brew link ocaml
brew link --overwrite ocaml

Note: I am new to OCaml.

persianturtle avatar Jun 11 '17 18:06 persianturtle

Have something similar. Installation of ocaml was totally broken. Need to uninstall everything and reinstal without reason-cli

stereobooster avatar Jul 25 '17 22:07 stereobooster

So, reason-cli just uses npm global binaries. This is a conflict between brew and npm. I'm curious what should happen if brew installs binary xyz and then npm installs xyz globally as well. Who should win? What if it occurs in the opposite install order? Should brew be able to shadow npm?

If you don't want global binaries shadowing paths, you can now install reason-cli as a local project dependency. (Just don't pass -g at install time). You then need to make sure that the project's node_modules/.bin directory is in your PATH when starting your editor.

jordwalke avatar Jul 26 '17 01:07 jordwalke

My story is: I wanted to try BetterErrors. BetterErrors recommends do this

To install BetterErrors we recommend installing reason-cli which ships with BetterErrors by default.

I had no intention to use reason or compilation to js, because I want write some OCaml code. But probably it was my error in first place, when I blindly followed the advice from BetterErrors :/

FIx for me was:

rm -rf /opt/boxen/nodenv/shims/ocamlc
rm -rf /opt/boxen/nodenv/shims/ocamlopt

stereobooster avatar Jul 26 '17 16:07 stereobooster

Same issue with my ocaml editor setup (ocp-indent) after installing reason-cli globally. Hopefully installing it locally will fix this. I use VIM btw

Tav0 avatar Dec 13 '17 02:12 Tav0

Thanks for the feedback. The latest release no longer installs ocamlopt etc. You'll have to clean up the existing links (npm remove -g reason-cli).

jordwalke avatar Dec 13 '17 06:12 jordwalke