elm-lang / elm-package

Command line tool to share Elm libraries
BSD 3-Clause "New" or "Revised" License
214 stars 66 forks source link

Confusing error when specified versions aren't available #236

Open opsb opened 8 years ago

opsb commented 8 years ago

I had the following elm-package.json

{
    "version": "1.0.0",
    "summary": "Sample Elm Test",
    "repository": "https://github.com/user/project.git",
    "license": "BSD-3-Clause",
    "source-directories": [
        ".",
        "../src"
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "4.0.0 <= v < 5.0.0",
        "rtfeldman/node-test-runner": "2.0.1 <= v < 3.0.0"
    },
    "elm-version": "0.17.0 <= v < 0.18.0"
}

and got an error when running

~/Projects/elm-uuid/tests$ rm -rf elm-stuff
~/Projects/elm-uuid/tests$ elm-package install
elm-package: elm-stuff/exact-dependencies.json: openBinaryFile: does not exist (No such file or directory)

As it turned out version 2.0.1 of "rtfeldman/node-test-runner" hadn't been published yet (it was only tagged on github). Ideally the error message would have been something along the lines of

Unable to resolve "rtfeldman/node-test-runner" within the range "2.0.1 <= v < 3.0.0"
Available versions "1.0.0 <= v <= 2.0.0"
process-bot commented 8 years ago

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.

rtfeldman commented 8 years ago

Nice, thank you for reporting this!

@evancz would an SSCCE help here, or is this clear enough as-is?

opsb commented 8 years ago

See https://github.com/opsb/confusing-elm-package-error to replicate