3
  • I do a fresh installation: npm i elm@0.18 -g
  • I try to build using: elm-make ./src/scripts/MainModule.elm
  • I get:

elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)

But the elm-package.json file is right there in the directory where elm-make is called from.

Thoughts?

Note: I'm using nvm, in case it matters.

Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125
  • Note, also [cross-posted on the Elm discourse](https://discourse.elm-lang.org/t/elm-make-elm-package-json-openbinaryfile-does-not-exist/3260/2) – glennsl Mar 04 '19 at 18:39
  • 1
    [Cross-posting is discouraged](https://meta.stackoverflow.com/questions/266053/is-it-ok-to-cross-post-a-question-between-non-stack-exchange-and-stack-exchange), especially when it's done immediately and without any reference to each other, because it wastes the time of those who try to help, and potentially also those looking for answers later if you don't follow up properly. – glennsl Mar 04 '19 at 18:41
  • I just added reference from discourse. I was about to add it here as well. Should I add it, or should I leave this as is with your comment? – Daniel Birowsky Popeski Mar 04 '19 at 18:43
  • Just as a comment is probably fine. Properly cross-referencing answers is more important. – glennsl Mar 04 '19 at 18:48

3 Answers3

2

I am able to reproduce the error by deleting elm-package.json, but leaving the elm-stuff/ directory. You should be able to fix this by deleting your elm-stuff/ directory and letting elm-make rebuild the project for you.

For reference, issue here: https://github.com/elm-lang/elm-make/issues/171

HParker
  • 1,567
  • 15
  • 19
0

@HParker is right, the only way to reproduce it is following these steps:

  1. Run elm-make and let it install all the dependencies
  2. Remove elm-package.json file
  3. Run elm-make again

If it's not your case you can debug what's going using strace, e. g.

strace -yfv elm-make 2>&1 | grep elm-package.json

Example output:

[pid 32319] openat(AT_FDCWD, "elm-package.json", O_RDONLY|O_NOCTTY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
[pid 32319] write(2<pipe:[427229]>, "elm-package.json: openBinaryFile"..., 76elm-package.json: openBinaryFile: does not exist (No such file or directory)) = 76

If it tries to open elm-package.json in current working directory you will see AT_FDCWD variable, if not you should see the full path.

Karol Samborski
  • 2,757
  • 1
  • 11
  • 18
0

The problem was that package authors were updating packages to support elm .19 by changing elm-package.json to elm.json but not bumping up major versions of their packages.

Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125