elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

confusing error when running `elm install` on a read-only elm.json #344

Open Zimmi48 opened 4 years ago

Zimmi48 commented 4 years ago

Quick Summary: message triggered by elm install elm/json on a freshly created elm-spa application.

SSCCE

elm-spa init # Accept default values
cd my-elm-spa
elm install elm/json # Accept to move to direct dependencies

Gives the error:

I ran into something that bypassed the normal error reporting process!
extracted whatever information I could from the internal error:

>   /home/theo/my-elm-spa/elm.json: openBinaryFile: permission denied 

Additional Details

If this is not reproducible, this might be due to the way I installed Elm and elm-spa using Nix. I would appreciate if someone could tell me whether they can reproduce this issue using the most standard (npm) installation method.

github-actions[bot] commented 4 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.

Zimmi48 commented 4 years ago

This should have been obvious from the start but I realize this only now: the error comes from the fact that somehow, this elm.json file didn't have any write-permissions. I suppose this is therefore mainly a bug of elm-spa, but I guess I'll still leave the issue open here because the Elm maintainers might still want to fix elm to fail graciously in the case of a read-only elm.json file.