Closed hpate-omicron closed 4 years ago
I just ran into the same issue. After doing an npm install -g elm-format
and changing the offending line to supportedPackages[packageInfo.name] = packageInfo.version;
, I could successfully run elm-upgrade
. It looks like elm-ugrade
only wants to know whether a given package exists, not which versions it has.
Fixed in 0.19.8
This came from slack - https://elmlang.slack.com/archives/C0CJ3SBBM/p1582057782068800
When the code tries to call
supportedPackages[packageInfo.name] = packageInfo.versions.slice(-1)[0];
it ends up with an error(node:19118) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'slice' of undefined
because theversions
property no longer exists in thesearch.json
from the package repo.Code with slice: https://github.com/avh4/elm-upgrade/blob/665c96251ceb71b9f2e1bd181db459a72120e80c/upgrade.js#L154
Search.json: https://package.elm-lang.org/search.json
It looks like this commit on the package repo changed it - https://github.com/elm/package.elm-lang.org/commit/ad9e8890426e943f396dcc0c1595b77d6239f499