gdotdesign/elm-ui

install not works on windows

mbadziong opened this issue · 6 comments

Windows 10 x64, elm 0.18, nodejs 6.x. Init passed successfully, fails on install:

C:\Users\xxx\repos\test>elm-ui install
Resolving versions...
error { '0':
Error: Unable to satisfy version constraint: gdotdesign/elm-ui@>=0.4.0 <1.0.0 from root
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:182:25
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:4320:15
at baseForOwn (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:2722:24)
at Function.forOwn (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:11992:24)
at SemverResolver.maxSatisfying (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:164:24)
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:279:32
at Array.forEach (native)
at SemverResolver.resolveVersions (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:274:26)
at process._tickCallback (internal/process/next_tick.js:103:7) }

Maybe this is the same issue: #36

I've tried with git bash console and it works for me. So workaround is available. Anyway, disabling firewalls, antiviruses doesn't provide successful installation on windows default console (and for example visual studio code console). It's a little annoying to use git bash, but thanks for help!

Another issue you may run into on Windows is from the Node package.json relying on the Unix shebang to execute the bin/index.js as a Node script. A quick fix for this is to actually put node.exe into the index.js script entries in package.json, seen below, or associate .js files with Node.

http://whitescreen.nicolaas.net/programming/windows-shebangs linked from http://stackoverflow.com/a/15448714 has an interesting workaround for getting Unix-like shebang behavior in Windows.

  "scripts": {
    "start": "node.exe bin/index.js server",
    "deploy": "gulp deploy",
    "predeploy": "npm run build",
    "build": "node.exe bin/index.js build",
    "test": "nightwatch spec/tests -e chrome,firefox",
    "elm-install": "elm-package install -y",
    "elm-docs": "elm-make --docs=documentation.json"
  },
Namek commented

npm install -g elm-github-install and then elm-github-install instead elm-ui install worked. Had to do it in babun instead of cmd because it calls git internally.

Oh, and added this to elm-package.json after init called:

"dependency-sources": {
  "gdotdesign/elm-ui": "https://github.com/gdotdesign/elm-ui.git"
},

https://github.com/gdotdesign/elm-github-install

Currently elm-ui is using the old version (0.2) of elm-github-install, the next version will use the latest available, until then this can be a workaround.

I'm closing this since I just released 1.0.0 which moves the development environment functionality to https://github.com/gdotdesign/elm-dev-env. It's using the latest version of elm-github-install. If the problem persist please open an issue there.