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

package-lock.json may cause 404 errors in install.js #210

Closed
justuswilhelm opened this issue Jun 22, 2017 · 3 comments
Closed

package-lock.json may cause 404 errors in install.js #210

justuswilhelm opened this issue Jun 22, 2017 · 3 comments
Assignees
Labels

Comments

@justuswilhelm
Copy link

justuswilhelm commented Jun 22, 2017

  1. Run npm install with an old npm version.
  2. Update npm to the newest release (5.x.x)
  3. Run npm install and let it create package-lock.json
  4. Delete contents of node_modules
  5. Run npm install and see the following error
> elm@0.18.0 install /Users/XXX/XXX/node_modules/elm                                 
> node install.js         
Unfortunately, there are currently no Elm Platform binaries available for your operating system and architecture.

If you would like to build Elm from source, there are instructions at https://github.com/elm-lang/elm-platform#build-from-source

Fix was for me to delete and recreate package-lock.json by running npm install one more time. It worked and the diff is

"elm": {
     "elm": {
-      "version": "https://registry.npmjs.org/elm/-/elm-0.18.0.tgz",
+      "version": "0.18.0",
+      "resolved": "https://registry.npmjs.org/elm/-/elm-0.18.0.tgz",
       "integrity": "sha1-kZuDCc2Tnf4v+dJS2WG2yJUJuXA="
       "integrity": "sha1-kZuDCc2Tnf4v+dJS2WG2yJUJuXA="
     },

My recommendation to the elm team would be to show the URL that was being downloaded in install.js as it incorrectly assembles the URL from faulty NPM data. I seriously thought that the platform indication was broken (and therefore causing a 404), but really it was NPM screwing up and giving wrong version information. But seeing the borked up URL string would have immediately told me that something is wrong with NPM.

@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.

@rtfeldman
Copy link

To summarize:

  1. Giving an error message of "there are no npm binaries available for your operating system and architecture" with the Elm version included, e.g. "there are no Elm 0.18 binaries available..." would have helped identify the root of the problem here.
  2. Disregarding any leading "https://registry.npmjs.org/elm/-/elm-" and trailing ".tgz" when parsing the version string would have prevented the bug in the first place.

@elm-lang elm-lang locked and limited conversation to collaborators Feb 22, 2018
@rtfeldman
Copy link

Tracking in #225

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

No branches or pull requests

4 participants