Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Unhelpful error if elm-stuff exists but elm-package.json doesn't #171

Open
avh4 opened this issue Jul 9, 2017 · 3 comments
Open

Unhelpful error if elm-stuff exists but elm-package.json doesn't #171

avh4 opened this issue Jul 9, 2017 · 3 comments

Comments

@avh4
Copy link

avh4 commented Jul 9, 2017

Running elm-make in a folder without an elm-package.json normally creates an elm-package.json for you. However, if an elm-stuff folder already exists, it instead gives an unhelpful error message: elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)

I would proposed that elm-make should behave the same regarding the existence of elm-package.json regardless of whether elm-stuff exists. Alternatively, a more helpful message (something like "There is no elm-package.json file. If you want elm-make to create one for you, first delete the elm-stuff folder.")

To reproduce:

elm-make --yes
rm elm-package.json
elm-make
--> elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)
@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@sashaafm
Copy link

sashaafm commented Feb 4, 2018

Bump.

This also seems to happen when elm-stuff exists with exact-dependencies.json inside. Besides the error message not being helpful at all, this does not fit my current use-case of versioning exact-dependencies.json, to always download the exact same version of a package.

If there's another way to achieve this use-case please tell me, as I couldn't find how to always download the same package down to the PATCH level.

EDIT: As a workaround it seems to be needed to delete the whole elm-stuff directory, which also deletes exact-dependencies.json. Then upon rebuilding one must hope the downloaded packages will match the ones in the versioned exact-dependencies.json, which is less than ideal.

@zwilias
Copy link
Member

zwilias commented Feb 4, 2018

You can manually add all the dependencies as found in exact-dependencies.json file to elm-package.json and restrict the version range to only allow a single version, e.g. 1.2.3 <= v < 1.2.4. The only version that could ever satisfy that constraint is 1.2.3 itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants