rtfeldman / elm-0.19-workshop

Elm 0.19 workshops. Includes Intro and Advanced courses.
MIT License
212 stars 121 forks source link

Elm version mismatch #12

Open davidg238 opened 5 years ago

davidg238 commented 5 years ago

I started the Elm Introduction v2 today, following the "Getting Started" instructions:

david ~ $ npm install -g elm elm-test@elm0.19.0 elm-format
npm WARN deprecated fsevents@1.2.4: Way too old
/home/david/.nvm/versions/node/v8.2.1/bin/elm -> /home/david/.nvm/versions/node/v8.2.1/lib/node_modules/elm/bin/elm
/home/david/.nvm/versions/node/v8.2.1/bin/elm-format -> /home/david/.nvm/versions/node/v8.2.1/lib/node_modules/elm-format/bin/elm-format
/home/david/.nvm/versions/node/v8.2.1/bin/elm-test -> /home/david/.nvm/versions/node/v8.2.1/lib/node_modules/elm-test/bin/elm-test
> elm@0.19.1-3 install /home/david/.nvm/versions/node/v8.2.1/lib/node_modules/elm
> node install.js
--------------------------------------------------------------------------------
Downloading Elm 0.19.1 from GitHub.

Then at the Introduction to Elm Workshop at the Build the Elm UI I got:

david workspaceUI $ cd elm-0.19-workshop/
david (master *) elm-0.19-workshop $ cd intro/server
david (master *) server $ elm make src/Main.elm --output=../server/public/elm.js
Dependencies ready!         
-- ELM VERSION MISMATCH ----------------------------------------------- elm.json

Your elm.json says this application needs a different version of Elm.

It requires 0.19.0, but you are using 0.19.1 right now.

david (master *) server $ 
benkoshy commented 4 years ago

@davidg88007 and for anyone else who's reading this:

The problem happens because you've installed 0.19.1 but the project you are using has listed it as 0.19.0.

A quick hack would be to go to the elm.json file and change the 0.19.0 value to the new version: 0.19.1.

e.g. here's my file

{
    "type": "application",
    "source-directories": [
        "src"
    ],
    "elm-version": "0.19.0"   <---------------- change to 0.19.1             ,
    "dependencies": {
        "direct": {
            "elm/browser": "1.0.0",
            "elm/core": "1.0.0",
            "elm/html": "1.0.0",
            "elm/random": "1.0.0"
        },
        "indirect": {
            "elm/json": "1.0.0",
            "elm/time": "1.0.0",
            "elm/url": "1.0.0",
            "elm/virtual-dom": "1.0.0"
        }
    },
    "test-dependencies": {
        "direct": {
            "elm-explorations/test": "1.0.0"
        },
        "indirect": {}
    }
}