reasonml-old / rebel

122 stars 16 forks source link

npm install --save-dev reasonml/rebel fails on macOS Sierra #55

Closed gnoff closed 8 years ago

gnoff commented 8 years ago

It is HIGHLY likely this is user error but I don't know ocaml or reason (other than trying to get reason up and running and then trying to install this according to the instructions in the readme)

I followed the reasonml installation instructions here: https://github.com/facebook/reason/blob/master/README.md#install-stable

I was able to validate installation by compiling the Hello.re toy exampale at the end of the installation instructions

I then followed the installation instructions here: https://github.com/reasonml/rebel#for-consumers

Installation fails at inotify. I don't really know anything about ocamlfind but it also was not mentioned in the reason or rebel install instructions so I am assuming I don't have to know about it to get this installed.

Initialized empty Git repository in /Users/joshstory/projects/helloreason/node_modules/inotify/.git/
ocamlfind: Package `lwt' not found
W: Field 'pkg_lwt' is not set: Command ''/Users/joshstory/projects/helloreason/node_modules/ocamlfind/_build/ocamlfind/bin/ocamlfind' query -format %d lwt > '/var/folders/qh/p_9n0rws5m7b62ntdpc7ymdc0000gn/T/oasis-e9a9e8.txt'' terminated with error code 2
ocamlfind: Package `lwt.unix' not found
W: Field 'pkg_lwt_unix' is not set: Command ''/Users/joshstory/projects/helloreason/node_modules/ocamlfind/_build/ocamlfind/bin/ocamlfind' query -format %d lwt.unix > '/var/folders/qh/p_9n0rws5m7b62ntdpc7ymdc0000gn/T/oasis-17888f.txt'' terminated with error code 2
E: Cannot find findlib package lwt
E: Cannot find findlib package lwt.unix
E: Failure("2 configuration errors")
/Users/joshstory/projects/helloreason
├── js_of_ocaml-bin@2.8.1  extraneous (git+https://github.com/reasonml/js_of_ocaml-bin.git#7e7b81c3a472432cbd80c96e3c738a55d83856e0)
├── ocamlBetterErrors@0.0.10  extraneous
├── reason@1.2.1  extraneous (git+https://github.com/facebook/reason.git#f1e92a3eba0065cf1ac8fe1c897fbd938bf9b88b)
└── yojson@1.3.2  extraneous (git+https://github.com/npm-opam/yojson.git#9d1ae17b1dd40ee0daefe0584fbdad67cb083f38)

npm WARN helloreason No description
npm WARN helloreason No repository field.
npm WARN helloreason No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: react@1.2.0 (node_modules/react):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: react@1.2.0 postinstall: `eval $(dependencyEnv) && nopam && ocaml pkg/git.ml && ocaml pkg/build.ml native=true native-dynlink=true && (opam-installer --prefix=$opam_prefix || true) && injectOpamEnvs`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/Users/joshstory/.npm-packages/bin/npm" "install" "--save-dev" "reasonml/rebel"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! inotify@2.1.0 postinstall: `eval $(dependencyEnv) && nopam && ocaml setup.ml -configure --${lwt_enable:-disable}-lwt --prefix $opam_prefix && ocaml setup.ml -build && ocaml setup.ml -install && (opam-installer --prefix=$opam_prefix || true) && injectOpamEnvs`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the inotify@2.1.0 postinstall script 'eval $(dependencyEnv) && nopam && ocaml setup.ml -configure --${lwt_enable:-disable}-lwt --prefix $opam_prefix && ocaml setup.ml -build && ocaml setup.ml -install && (opam-installer --prefix=$opam_prefix || true) && injectOpamEnvs'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the inotify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eval $(dependencyEnv) && nopam && ocaml setup.ml -configure --${lwt_enable:-disable}-lwt --prefix $opam_prefix && ocaml setup.ml -build && ocaml setup.ml -install && (opam-installer --prefix=$opam_prefix || true) && injectOpamEnvs
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs inotify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls inotify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/joshstory/projects/helloreason/npm-debug.log

Thanks, Josh

anmonteiro commented 8 years ago

also getting the same error, @gnoff beat me to opening basically the same issue

vramana commented 8 years ago

cc @yunxing I think the error is coming from installing jenga

chenglou commented 8 years ago

Yeah consistently repros

jordwalke commented 8 years ago

Why did it previously work when you tested? Was it succeeding because jenga was installed via opam or something?

vramana commented 8 years ago

@gnoff @anmonteiro Can you try the latest master? This is issue seems to be fixed.

anmonteiro commented 8 years ago

@vramana yep, now installs. I would expect to find a rebel executable in node_modules/.bin/ though, is this a wrong expectation?

vramana commented 8 years ago

We currently expect that you run eval $(dependencyEnv). This injects rebel binary into PATH. I haven't updated the Readme. So your npm script should look like this.

"scripts": {
  "start": "eval $(dependencyEnv) && rebel"
}
gnoff commented 8 years ago

@vramana Ok install works now.

unfortunately the start script does not. I get

> eval $(dependencyEnv) && rebel

sh: rebel: command not found

I tried running dependencyEnv directly and don't get any output so I don't think there is anything for me to eval

jordwalke commented 8 years ago

Can you show your package.json?

Also, here's a new project we just made that will be running on CI so we know it has to work on a fresh machine. (Currently building for the first time, so if it passes, then you can just clone that project to get started) https://travis-ci.org/reasonml/RebelExampleProject

gnoff commented 8 years ago

@jordwalke

{
  "name": "helloreason",
  "dependencies": {},
  "scripts": {
    "start": "eval $(dependencyEnv) && rebel",
    "env": "dependencyEnv"
  },
  "rebel": {},
  "devDependencies": {
    "rebel": "github:reasonml/rebel"
  }
}

the env script was just to see if there was output from dependencyEnv command run within the npm bin context.

jordwalke commented 8 years ago

I'd suggest using the RebelExampleProject. Its tests run frequently, so it's known to work well. If that doesn't work, then we have a problem. npm install reasonml/rebel isn't a tested installation method. Installing from package.json that is already created (as the example project has) is tested/supported.

gnoff commented 8 years ago

RebelExampleProject works like a charm. Thanks for the help

jordwalke commented 8 years ago

I commend your patience waiting for the compile times! We have a plan to (very soon) reduce it to about a third of what it is the first time, and to cache the artifacts for the second time you clone it as the basis for a project.

gnoff commented 8 years ago

yeah, that install would be rough to do casually. Glad to hear it will get shorter soon.

vramana commented 8 years ago

@gnoff The problem in that config was using rebel as devDependency. It will work fine if it was a dependency.

gnoff commented 8 years ago

@vramana created #64 to clear up possible confusion in readme.