dillonkearns / elm-pages-starter

Starter blog for elm-pages
https://elm-pages-starter.netlify.com
95 stars 41 forks source link

Invalid package dependencies on npm start #4

Closed kodeFant closed 4 years ago

kodeFant commented 5 years ago

Hi! Thanks for a bunch of great elm software! Really looking forward to checking out this one.

I am trying to run the elm-pages-starter according to the instructions on the docs and it seems like there is something off with some of the elm packages, maybe a deprecated package?

I am using MacOS Catalina and node v11.12.0.

Tried to delete and clone it from scratch a couple of times with same result.

I could try to go through each dependency and try to figure out where it lies, but figured I should hear with you first.

➜ npm start                         

> elm-pages-example@1.0.0 start /Users/lillo/kodefant/elm-tabber/packages/elm-pages-starter
> elm-pages develop

Running elm-pages...
elm-pages DONE
(node:79093) UnhandledPromiseRejectionWarning: Error: Compilation failed
-- INVALID PACKAGE DEPENDENCIES --------------------------------------- elm.json

The dependencies in your elm.json are not compatible.

Did you change them by hand? Try to change it back! It is much better to add
dependencies with elm install or the dependency management tool in elm reactor.

Please ask for help on the Elm slack <http://elmlang.herokuapp.com/> if you try
those paths and still cannot figure it out!

    at ChildProcess.<anonymous> (/Users/lillo/kodefant/elm-tabber/packages/elm-pages-starter/node_modules/node-elm-compiler/dist/index.js:131:35)
    at ChildProcess.emit (events.js:197:13)
    at maybeClose (internal/child_process.js:988:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
(node:79093) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:79093) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
kodeFant commented 5 years ago

Not sure if I was the only one experiencing the issue, but if it could be of any help for anyone else, I removed all direct dependencies and installed them with elm install until the compiler stopped complaining, and the result was this elm.json file:

{
    "type": "application",
    "source-directories": [
        "src",
        "gen"
    ],
    "elm-version": "0.19.0",
    "dependencies": {
        "direct": {
            "avh4/elm-color": "1.0.0",
            "dillonkearns/elm-pages": "1.0.0",
            "elm/browser": "1.0.1",
            "elm/core": "1.0.2",
            "elm/html": "1.0.0",
            "elm/http": "2.0.0",
            "elm/json": "1.1.3",
            "elm/parser": "1.1.0",
            "elm/svg": "1.0.1",
            "elm/url": "1.0.0",
            "elm-community/list-extra": "8.2.2",
            "elm-community/result-extra": "2.2.1",
            "elm-community/string-extra": "4.0.1",
            "elm-explorations/markdown": "1.0.0",
            "justinmimbs/date": "3.1.2",
            "lukewestby/elm-string-interpolate": "1.0.4",
            "mdgriffith/elm-markup": "3.0.1",
            "mdgriffith/elm-ui": "1.1.5",
            "noahzgordon/elm-color-extra": "1.0.2",
            "rtfeldman/elm-hex": "1.0.0"
        },
        "indirect": {
            "elm/bytes": "1.0.8",
            "elm/file": "1.0.5",
            "elm/regex": "1.0.0",
            "elm/time": "1.0.0",
            "elm/virtual-dom": "1.0.2",
            "fredcy/elm-parseint": "2.0.1"
        }
    },
    "test-dependencies": {
        "direct": {
            "elm-explorations/test": "1.2.2"
        },
        "indirect": {
            "elm/random": "1.0.0"
        }
    }
}
codyshepherd commented 4 years ago

I'm encountering the same issue with a fresh clone, running on Ubuntu 19.10. However, the json you've posted above is identical to elm.json currently in this repo.

codyshepherd commented 4 years ago

As an update, the default clone-install-start instructions worked fine for me on another machine, also running Ubuntu 19.10, but still throw this exception on my original box after both node and npm reinstall and update. Unclear at the moment what the difference is.

codyshepherd commented 4 years ago

Aha! Turns out I had some cruft in my ~/.elm directory. Deleting that directory seemed to fix this error for me.

caseyhoward commented 4 years ago

Deleting my ~/.elm directory did the trick. Weird.

dillonkearns commented 4 years ago

Thanks for reporting back! I'll close this as it sounds like this is resolved. Thanks!