GithubHelp home page GithubHelp logo

gdotdesign / elm-github-install Goto Github PK

View Code? Open in Web Editor NEW
205.0 10.0 24.0 150 KB

An alternative decentralized package manager for Elm

License: MIT License

JavaScript 6.70% Ruby 92.01% Batchfile 0.57% Shell 0.72%
elm package-manager

elm-github-install's Introduction

elm-install

Gem Version Npm version Code Climate Test Coverage Inline docs Build Status


This only works with Elm 0.18 and has not been updated to work with Elm 0.19

In Elm 0.19 how native works has changed and also how packages are installed and resolved, because of this it might not be possible to install third party native packages ever.

For more information check this issue: #62


This gem/npm-package allows you to install Elm packages in a decentralized way from Git repositories, this allows:

  • installing of effect manager and native packages
  • installing forks of packages for testing or unreleased features
  • using packages from local directories
  • installing private packages using private git repositories
  • installing packages offline (packages are cached)

Installation

If you have ruby installed on your machine then you can install it directly from rubygems.org:

gem install elm_install

If you have node.js installed on your machine then you can install it directly from npm:

npm install elm-github-install -g

or with yarn:

yarn global add elm-github-install

If you are experiencing EACCES: permission denied errors during installation using NPM then you can try:

sudo npm i -g elm-github-install --unsafe-perm=true --allow-root

There are also dependency free versions available for every release in the releases page.

Basic Usage

Once installed elm-install can be used instead of elm-package as a replacement:

elm-package.json:

{
  ...
  "dependencies": {
    "elm-lang/core": "5.0.0 <= v < 6.0.0",
    "elm-lang/svg": "2.0.0 <= v < 3.0.0",
    "elm-lang/dom": "1.1.1 <= v < 2.0.0"
  }
  ...
}

Command:

$ elm-install

Resolving packages...
  ▶ Package: https://github.com/elm-lang/core not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/svg not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/html not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/virtual-dom not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/dom not found in cache, cloning...
Solving dependencies...
  ● elm-lang/core - https://github.com/elm-lang/core (5.1.1)
  ● elm-lang/svg - https://github.com/elm-lang/svg (2.0.0)
  ● elm-lang/dom - https://github.com/elm-lang/dom (1.1.1)
  ● elm-lang/html - https://github.com/elm-lang/html (2.0.0)
  ● elm-lang/virtual-dom - https://github.com/elm-lang/virtual-dom (2.0.4)
Packages configured successfully!

Advanced Usage

Sources can be defined in the dependency-sources field in elm-package.json for any package defined in the dependencies field.

The source can be defined as:

  • an URL pointing to a Git repository:
    "elm-lang/core": "[email protected]:someuser/core"
    
  • a hash containing the URL and the reference (tag, commit hash, branch) to use:
    "gdotdesign/elm-install-test": {
      "url": "[email protected]:gdotdesign/elm-install-test",
      "ref": "master"
    }
    
  • an absolute or relative path to the package in your hard drive:
    "elm-lang/dom": "../elm-lang/dom"
    

If a reference or a path is defined then the version in the dependencies field is ignored and the version will be used from the elm-package.json at that source.

Examples:

  ...
  "dependencies": {
    "gdotdesign/elm-install-test": "1.0.0 <= v < 2.0.0",
    "elm-lang/core": "5.0.0 <= v < 6.0.0",
    "elm-lang/svg": "2.0.0 <= v < 3.0.0",
    "elm-lang/dom": "1.1.1 <= v < 2.0.0"
  },
  "dependency-sources": {
    "elm-lang/core": "[email protected]:someuser/core",
    "elm-lang/dom": "../elm-lang/dom",
    "gdotdesign/elm-install-test": {
      "url": "[email protected]:gdotdesign/elm-install-test",
      "ref": "master"
    }
  }
  ...

CLI

Help for the elm-install command:

NAME:

  elm-install

DESCRIPTION:

  Install Elm packages from Git repositories.

COMMANDS:

  help    Display global or [command] help documentation
  install Install Elm packages from the elm-package.json file.

GLOBAL OPTIONS:

  -h, --help
      Display help documentation

  -v, --version
      Display version information

  -t, --trace
      Display backtrace when an error occurs

Help for the elm-install install command.

NAME:

  install

SYNOPSIS:

  elm-install install

DESCRIPTION:

  Install Elm packages from the elm-package.json file.

OPTIONS:

  --cache-directory STRING
      Specifies where the cache is stored

  --skip-update
      Skips the update stage of packages

  --only-update STRING
      Only updates the given package

  --verbose

Known Issues

  • Using the NPM package or the released binaries in windows while specifing a relative directory as a package will fail because of the 2.2 travelling ruby dependency. Using the >Ruby 2.3 with the gem installed works properly. More #36

FAQ

Do I need to use SSH keys?

It depends on your use case, but for public repositories in Github or Bitbucket it's not needed.

What url protocols are supported?

The following protocols can be used:

  • ssh://[user@]host.xz[:port]/path/to/repo.git/
  • git://host.xz[:port]/path/to/repo.git/
  • http[s]://host.xz[:port]/path/to/repo.git/
  • [user@]host.xz:path/to/repo.git/

Can I install from private repositories?

Yes private repositories are supported provided you have authentication (for example SSH keys).

elm-github-install's People

Contributors

camjc avatar dworthen avatar gdotdesign avatar martinos avatar nicolasleger avatar ream88 avatar yjkogan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elm-github-install's Issues

Trouble using with elm-test

I get this output:

$ elm-test

Error: Your .elm/packages/ directory may be corrupted. I was led to believe that
saschatimme/elm-phoenix existed, but I could not find anything when I went to
look up the published versions of this package.

I tried running elm-github-install from within my tests directory (using its own elm-package.json) but that didn't help.

Aliasing a package from a forked repository

Just to start off, the problem may not actually be with elm-github-install, but instead with the elm native naming convention.

I'm using a library in elm-community that I am also contributing to (without write access, just via PRs). This repo implements a native module, and that works. I own an unmerged branch that I need features from.

My issue is that native modules force the naming _packageOwner$packageName$path$Native_Thing.

When I try "mrozbarry/packageName" in my elm-package.json, I can install, but elm can't find the correct native code, which is "_originalAuthor$packge_name" and elm is looking for "_mrozbarry$package_name"

"dependencies": {
  "mrozbarry/canvas": "..."
},
"dependency-sources": {
  "mrozbarry/canvas": {
    "url": "[email protected]/mrozbarry/canvas",
    "ref": "draw-image"
  }
}

elm-github-install throws an error when I try aliasing like this:

"dependencies": {
  "elm-community/canvas": "..."
},
"dependency-sources": {
  "elm-community/canvas": {
    "url": "[email protected]/mrozbarry/canvas",
    "ref": "draw-image"
  }
}
$ elm-install
Resolving packages...

  The source of package elm-community/canvas is set to https://github.com/mrozbarry/canvas which would
  be install to elm-stuff/mrozbarry/canvas. This would cause a conflict
  when trying to compile anything.

  The name of a package must match the source url's path.

  elm-community/canvas <=> mrozbarry/canvas

Any reason your git clone couldn't do something like git clone gitUrl packageOwnerAndName?

Cygwin support

Running elm-install on cygwin produces errors:

$ pwd
/cygdrive/c/work/project/

$ elm-install
error: git clone "--" "https://github.com/NoRedInk/elm-decode-pipeline" "C:/work/ext/cygwin/home/user/.elm-install/github.com/NoRedInk/elm-decode-pipeline" 2>&1:fatal: Invalid path '/cygdrive/c/work/project/C:/work': No such file or directory. Use --trace to view backtrace
Resolving packages...
▶ Package: https://github.com/NoRedInk/elm-decode-pipeline not found in cache, cloning...

I've debugged further and it turns out that path here is receiving a path with the windows volume:

C:/work/ext/cygwin/home/user/.elm-install/github.com/NoRedInk/elm-decode-pipeline

The problem with this is that when passed to git, git interprets C:/..... as a path relative to pwd, hence we see the invalid path /cygdrive/c/work/project/C:/work in the error above.

After monkey patching the paths to have a proper absolute Unix path, we get more errors:

C:/work/ext/cygwin/home/user/elm-install-1.4.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir': Invalid argument @ dir_s_mkdir - /work/ext/cygwin/home/user/.elm-install/github.com/elm-lang/core (Errno::EINVAL)

Afraid I've hit a wall here as I'm not a ruby expert.

Error installing mgold/elm-date-format

First, thank you for the library, it has made it way easier to handle private Elm packages!

I noticed this on our CI when it updated to v1.3.0, it didn't happen previously on v1.2.0:

Short version:

elm-github-install install
Resolving packages...
  ▶ Getting updates for: mgold/elm-date-format
error: git '--git-dir=/Users/hpate/.elm-install/github.com/mgold/elm-date-format/.git' '--work-tree=/Users/hpate/.elm-install/github.com/mgold/elm-date-format' checkout '0.1.0'  2>&1:error: pathspec '0.1.0' did not match any file(s) known to git.. Use --trace to view backtrace

With trace on:

$ elm-github-install --trace
Resolving packages...
  ▶ Getting updates for: mgold/elm-date-format
/Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/lib.rb:937:in `command': git '--git-dir=/Users/hpate/.elm-install/github.com/mgold/elm-date-format/.git' '--work-tree=/Users/hpate/.elm-install/github.com/mgold/elm-date-format' checkout '0.1.0'  2>&1:error: pathspec '0.1.0' did not match any file(s) known to git. (Git::GitExecuteError)
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/lib.rb:644:in `checkout'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/base.rb:306:in `checkout'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/repository.rb:36:in `checkout'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/git_source.rb:44:in `fetch'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/git_source.rb:104:in `block in matching_versions'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/git_source.rb:103:in `select'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/git_source.rb:103:in `matching_versions'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/git_source.rb:89:in `versions'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/resolver.rb:43:in `resolve_dependency'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/resolver.rb:26:in `block in resolve'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/resolver.rb:25:in `each'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/resolver.rb:25:in `resolve'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install/installer.rb:23:in `install'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/lib/elm_install.rb:40:in `install'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.3.0/bin/elm-install:18:in `block (2 levels) in <top (required)>'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
	from /Users/hpate/.nvm/versions/node/v8.2.1/lib/node_modules/elm-github-install/scripts/dist-1.3.0/elm-install-1.3.0-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

Minimal case:

{
    "version": "1.0.0",
    "dependencies": {
        "mgold/elm-date-format": "1.4.0 <= v < 2.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

I looked through the elm-date-format repo and I think it may be that the 0.1.0 version is tagged as 0.1 in the Github release - https://github.com/mgold/elm-date-format/releases?after=0.1.1

Here's the output from v1.2.0:

elm-github-install install
Resolving packages...
  ▶ Getting updates for: mgold/elm-date-format
  ▶ Getting updates for: elm-lang/core
Solving dependencies...
  ● mgold/elm-date-format - https://github.com/mgold/elm-date-format (1.4.0)
  ● elm-lang/core - https://github.com/elm-lang/core (5.1.1)
Packages configured successfully!

`elm-install` just failing with contract failure for jRuby

I'm getting an issue with contract violation around parsing constraints.

Here's my minimal package.json:

$ cat elm-package.json 
{
    "version": "1.0.0",
    "summary": "helpful summary of your project, less than 80 characters",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "source-directories": [
        "."
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.1.1 <= v < 6.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

And here's the error that I get.

$ elm-install 
/home/robert/.rbenv/versions/jruby-9.1.12.0/lib/ruby/gems/shared/gems/commander-4.4.3/lib/commander/user_interaction.rb:334: warning: constant ::JavaPackageModuleTemplate is deprecated
error: Contract violation for return value:
        Expected: [Solve::Constraint],
        Actual: [#<Solve::Constraint < 6.0.0>, #<Solve::Constraint >= 5.1.1>]
        Value guarded in: ElmInstall::Utils::transform_constraint
        With Contract: String => Array
        At: /home/robert/.rbenv/versions/jruby-9.1.12.0/lib/ruby/gems/shared/gems/elm_install-1.1.1/lib/elm_install/utils.rb:23 . Use --trace to view backtrace

Here's the version information, for the record:

$ elm-install help -v
/home/robert/.rbenv/versions/jruby-9.1.12.0/lib/ruby/gems/shared/gems/commander-4.4.3/lib/commander/user_interaction.rb:334: warning: constant ::JavaPackageModuleTemplate is deprecated
elm-install 1.1.1

Any idea what is up?

Support for other repository management tools

Are there ideas/plans to support other repository management tools such as:

  • Bitbucket
  • Bitbucket Server
  • GitLab
  • ...

I am willing to implement this, but how would this reflect on the current functionality?

error on install this package truqu/elm-base64

on install this package i get un error like
elm-install Resolving packages... ▶ Package: https://github.com/truqu/elm-base64 is outdated, fetching changes... ▶ Package: https://github.com/maxsnew/IO is outdated, fetching changes... ▶ Package: https://github.com/deadfoxygrandpa/Elm-Test is outdated, fetching changes... ▶ Package: https://github.com/laszlopandy/elm-console is outdated, fetching changes... ▶ Package: https://github.com/NoRedInk/elm-check is outdated, fetching changes... ▶ Package: https://github.com/NoRedInk/elm-random-extra is outdated, fetching changes... ... and continues ...
http://package.elm-lang.org/packages/truqu/elm-base64/latest/Base64

Correct usage

Hi. I'm wondering if this is the correct usage:

{
    "version": "0.0.1",
    "summary": "my project",
    "repository": "https://github.com/user/project.git",
    "license": "bsd3",
    "source-directories": [
        "."
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "1.0.0 <= v < 1.0.9",
        "elm-lang/navigation": "2.0.1 <= v < 3.0.0",
        "evancz/url-parser": "2.0.1 <= v < 2.0.3",
        "NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 3.0.1",
        "elm-lang/dom": "1.1.1 <= v < 1.1.2"
    },
    "dependency-sources": {
       "aforemny/elm-mdl": {
         "url": "https://github.com/aforemny/elm-mdl.git",
         "ref": "component-select"
       }
    },
    "elm-version": "0.18.0 <= v < 0.18.1"
}

I have this in my elm-package.json and ran elm-install, but it seemed to have failed to fetch the aforemny/elm-mdl package. Thanks for your work in putting this project together!

Setting a package to { url: "gitrepo", ref: "branch" } throws an error.

In advanced usage, you have an example of:

"gdotdesign/elm-install-test": {
  "url": "[email protected]:gdotdesign/elm-install-test",
  "ref": "master"
}

But doing that in my code throws:

/Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/utils.rb:20:in `transform_constraint': undefined method `gsub!' for #<Hash:0x007fdb441d0598> (NoMethodError)
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/resolver.rb:43:in `block in add_dependencies'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/resolver.rb:40:in `each'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/resolver.rb:40:in `flat_map'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/resolver.rb:40:in `add_dependencies'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/resolver.rb:26:in `add_constraints'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/installer.rb:73:in `retry_install'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/installer.rb:52:in `rescue in install'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install/installer.rb:46:in `install'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/lib/elm_install.rb:24:in `install'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-0.3.1/bin/elm-install:18:in `block (2 levels) in <top (required)>'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
        from /Users/mrozbarry/.elm-install/elm-install-0.3.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

It looks like your spec tests only test if a repository string, and not if it's a hash with url and ref.

elm-install not working

It was working fine with elm-ui until I tried adding elm-community/list-extra. I am fairly new to elm. Need help.

I am getting following message when I try elm-install install.

$ elm-install install
Resolving packages...
Solving dependencies...
Saving package cache...
  ▶ Could not find a solution in local cache, refreshing packages...
Saving package cache...
Could not find a solution:
  Unable to satisfy the following requirements:
  
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `user-specified dependency`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `user-specified dependency`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/elm-lang/http-1.0.0`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-lang/http-1.0.0`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/elm-lang/keyboard-1.0.1`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-lang/keyboard-1.0.1`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/elm-lang/html-2.0.0`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-lang/html-2.0.0`
  - `https://github.com/elm-lang/core (>= 4.0.0)` required by `https://github.com/elm-lang/html-2.0.0`
  - `https://github.com/elm-lang/core (>= 4.0.0)` required by `https://github.com/elm-lang/dom-1.1.1`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-lang/dom-1.1.1`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/evancz/url-parser-2.0.1`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/evancz/url-parser-2.0.1`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/elm-lang/navigation-2.1.0`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-lang/navigation-2.1.0`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/elm-community/dict-extra-1.3.2`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/elm-community/dict-extra-1.3.2`
  - `https://github.com/elm-lang/core (>= 5.0.0)` required by `https://github.com/NoRedInk/elm-decode-pipeline-3.0.0`
  - `https://github.com/elm-lang/core (< 6.0.0)` required by `https://github.com/NoRedInk/elm-decode-pipeline-3.0.0`
  - `https://github.com/elm-lang/core (<= 4.0.0)` required by `https://github.com/elm-community/list-extra-1.0.0`
  - `https://github.com/elm-lang/core (>= 4.0.0)` required by `https://github.com/elm-community/list-extra-1.0.0`

Symlinks on Windows

When we define dependency-source as local folder then elm-install want to create symlink pointing to that folder. This works on macOS or Linux but on Windows we got error reported by FileUtils.rb

symlink': symlink() function is unimplemented on this machine (NotImplementedError)
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:357:in `block in ln_s'

This issue (creating symbolic link on Windows) seems to be solved in Ruby 2.3. Do you have plan to update to 2.3?

Entire report:

C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:357:in `symlink': symlink() function is unimplemented on this machine (NotImplementedError)
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:357:in `block in ln_s'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:1586:in `fu_each_src_dest0'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/ruby/lib/ruby/2.2.0/fileutils.rb:355:in `ln_s'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/directory_source.rb:43:in `copy_to'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/populator.rb:59:in `block in copy_dependencies'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/populator.rb:52:in `each'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/populator.rb:52:in `copy_dependencies'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/populator.rb:21:in `populate'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install/installer.rb:26:in `install'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/lib/elm_install.rb:41:in `install'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.1.0/bin/elm-install:18:in `block (2 levels) in <top (required)>'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:71:in `run!'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
        from C:/Users/aprialuk/.elm-install/elm-install-1.1.0-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

Error Pulling from gitlab.

Mirrored elm repos from github and redirecting to gitlab with:

dependency-sources": {
    "elm-lang/core": "https://repo.company.com/vendor/github.com_elm-lang_core",`
},

Fails with the following error:

elm-install --trace                                                                                                                                                                                                                              
Resolving packages...                                                                                                                                                                                                    
  ▶ Getting updates for: vendor/github.com_elm-lang_core                                                                                                                                                                                                                           
/Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/semverse-2.0.0/lib/semverse/version.rb:29:in `split': '' did not contain a valid version string: 'x.y.z' or 'x.y'. (Semverse::Invali
dVersionFormat)                                                                                                                                                                                                                                                                    
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/semverse-2.0.0/lib/semverse/version.rb:64:in `initialize'                                                              
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:45:in `new'                                                            
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:45:in `version'                                                        
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/git_source.rb:105:in `versions'                                                      
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:45:in `resolve_dependency'                                               
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:75:in `block in resolve_dependencies'                                    
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:70:in `each'                                                             
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:70:in `resolve_dependencies'                                             
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:53:in `block in resolve_dependency'                                      
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:51:in `each'                                                             
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:51:in `resolve_dependency'                                               
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:28:in `block in resolve'                                                 
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:27:in `each'                                                             
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:27:in `resolve'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:25:in `install'                                                         
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'                                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'                                                          
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'                                     
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `install'                                                                   
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/bin/elm-install:20:in `block (2 levels) in <top (required)>'                                         
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'                                                                 
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'                                                                 
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'                                                                  
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'                                                    
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'                                                                   
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'                                                                
        from /Users/edwardmcfarlane/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'    

Tags are maintained for the cloned repos. What could be causing this?

Package author and name are not case sensitive.

I have the following in an elm-package.json:

    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "tsfoster/elm-heap": "2.1.0 <= v < 3.0.0"
    },

This installs fine with elm-github-install, as it seems to just use the auther/package name in building a URL to access github.

When I try to install this with elm-pakcage

Error: Your .elm/packages/ directory may be corrupted. I was led to believe that
tsfoster/elm-heap existed, but I could not find anything when I went to look up
the published versions of this package.

The actual package name is 'TSFoster/elm-heap'.

It seems that to elm-make, elm-reactor and elm-publish the case sensitivity of the author and package name is important.

This causes a problem, as I am in the habit of using elm-github-install instead of elm-package install for the extra flexibility it gives me, but if I am not careful this can lead to publishing an elm-package.json that is invalid.

It would be better if elm-github-install enforced the same behaviour as the core elm tools?

elm-install not working with elm-mdl

I've seen a very similar issue to this, where Aux.elm doesn't work. However that
issue was solved when you changed the file name to Helper.elm. I'm not sure why I'm still getting this error, I tried installing the latest version but it didn't work.

Heres the trace

λ elm-github-install --trace
Resolving packages...
▶ Getting updates for: debois/elm-mdl
C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/lib.rb:937:in command': git "--git-dir=C:/Users/code/.elm-install/github.com/debois/elm-mdl/.git" "--work-tree=C:/Users/code/.elm-install/github.com/debois/elm-mdl" reset "--hard" 2>&1:error: unable to create file src/Material/Aux.elm (No such file or directory) (Git::GitExecuteError) fatal: Could not reset index file to revision 'HEAD'. from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/lib.rb:562:in reset'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/git-1.3.0/lib/git/base.rb:242:in reset_hard' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/repository.rb:85:in repo'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/repository.rb:101:in fetch'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/git_source.rb:100:in versions' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:45:in resolve_dependency' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:28:in block in resolve' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:27:in each'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/resolver.rb:27:in resolve' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:25:in install' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in install' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/bin/elm-install:20:in block (2 levels) in <top (required)>'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in call' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in call'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in run' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in run_active_command'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in run!' from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in run!'
from C:/Users/code/AppData/Roaming/npm/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-win32/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

Return code

I often chain commands together, like:

$ elm-install && make ...

then get coffee.

It seems elm-install always returns success (exitcode 0):

conrad@spitfire:~/src/elm/dreambuggy$ elm-install
...
Solving dependencies...
  ▶ No solution found: Unable to satisfy the following requirements:

- `here4/here4 (< 4.0.0)` required by `user-specified dependency`
- `here4/here4 (>= 3.3.8)` required by `user-specified dependency`
conrad@spitfire:~/src/elm/dreambuggy$ echo $?
0

so the commandline chain doesn't work: if I do "elm-install && make" then make should not run.

Solving dependencies fails.

Solving dependencies fails with this error:

Solving dependencies... /var/lib/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:80:in block in resolve': undefined method name' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:79:in each'
from /var/lib/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:79:in inject' from /var/lib/gems/2.3.0/gems/solve-3.1.0/lib/solve/ruby_solver.rb:79:in resolve'
from /var/lib/gems/2.3.0/gems/solve-3.1.0/lib/solve.rb:64:in it!' from /var/lib/gems/2.3.0/gems/elm_install-1.1.0/lib/elm_install/installer.rb:40:in results'
from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to' from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with'
from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method' from /var/lib/gems/2.3.0/gems/elm_install-1.1.0/lib/elm_install/installer.rb:26:in install'
from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in send_to' from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in call_with'
from /var/lib/gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in block in redefine_method' from /var/lib/gems/2.3.0/gems/elm_install-1.1.0/lib/elm_install.rb:41:in install'
from /var/lib/gems/2.3.0/gems/elm_install-1.1.0/bin/elm-install:18:in block (2 levels) in <top (required)>' from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:178:in call'
from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:153:in run' from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in run_active_command'
from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in run!' from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in run!'
from /var/lib/gems/2.3.0/gems/commander-4.4.3/lib/commander/import.rb:5:in block in <top (required)>'

=== Running 'ruby --version' reports:
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]

Any other things I can report to help diagnose the problem, please let me know.

I just upgraded my system to Debian 9 from 8, was all working previously. I guess a version of something is diferent now...

Over-reliance on cache

I just used elm-install for the first time in a while, and the library I wanted to access had had several updates since my last use. What was installed was the old cached version, and the only way I could find around it was to change my elm-package.json to use the latest version.

Surely there should be some sort of check of cached versions vs what's on github?

Newest version does NOT get installed

I had a repo go from version 4.1.0 to 4.1.1. My elm-package.json is looking for 4.0.0 <= v < 5.0.0.

Every time I run elm-github-install, it finds the 4.1.0 version in the cache and installs that.

The only way to get it to install correctly, is to DELETE the cache files.

Can't install with local path in "dependency-sources"

I've added a local path to "dependency-sources" (I've tried both relative and absolute paths). My elm-package.json looks like this:

{
    "version": "1.0.0",
    "summary": "helpful summary of your project, less than 80 characters",
    "repository": "https://github.com/user/project.git",
    "license": "",
    "source-directories": [
        "./src"
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.1.1 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "mdgriffith/style-elements": "4.1.0 <= v < 5.0.0",
        "bloom/bb": "1.0.0 <= v < 2.0.0"
    },
    "dependency-sources": {
      "bloom/bb": "../bloom/bb",
    }, 
    "elm-version": "0.18.0 <= v < 0.19.0"
}

I've deleted elm-stuff, and whenever I run elm-install I get the following error message:

λ elm-install --trace
Resolving packages...
Solving dependencies...
/Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:30:in `binwrite': No such file or directory @ rb_sysopen - elm-stuff/exact-dependencies.json (Errno::ENOENT)
        from /Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:30:in `write_exact_dependencies'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:22:in `populate'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:28:in `install'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /Library/Ruby/Gems/2.3.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `install'
        from /Library/Ruby/Gems/2.3.0/gems/elm_install-1.6.1/bin/elm-install:20:in `block (2 levels) in <top (required)>'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
        from /Library/Ruby/Gems/2.3.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

I've tried both an npm installed version of elm-install, and the globally installed gem.

I've tried creating the elm-stuff directory by hand and running elm-install, in which case it just writes out an exact_dependencies.json file with only an empty object inside, and reports having completed installation successfully.

Running on Mac OS High Sierra 10.13.1 Beta (17B25c) with system ruby (2.3.3p222)

Any ideas?
If I remove the local package from dependency-sources, installation of the other packages appears to work as expected.

Thanks for this tool, and for your time!

Unable to satisfy requirements error when there is a perfect match

I'm getting the following error:

Resolving packages...
Solving dependencies...
  ▶ No solution found: Unable to satisfy the following requirements:

- `elm-community/maybe-extra (>= 4.0.0)` required by `elm-slate/api-2.0.0`
- `elm-community/maybe-extra (< 5.0.0)` required by `elm-slate/api-2.0.0`
- `elm-community/maybe-extra (>= 4.0.0)` required by `guardian/session-api-common-1.0.0`
- `elm-community/maybe-extra (< 5.0.0)` required by `guardian/session-api-common-1.0.0`

Clearly, these match.

elm-slate/api comes from Github and guardian/session-api-common comes from our in-house Gitlab server.

When I EXPLICITLY add elm-community/maybe-extra to my elm-package.json, it works.

Here's my elm-package.json that fails:

{
    "version": "1.0.0",
    "summary": "Session Api for Clients",
    "repository": "https://github.com/guardian/session-api-client.git",
    "license": "Unlicense",
    "source-directories": [
        "src"
    ],
    "exposed-modules": [
        "Api.Session.Api"
    ],
    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "mgold/elm-random-pcg": "4.0.2 <= v < 5.0.0",
        "panosoft/elm-string-utils": "2.0.0 <= v < 3.0.0",
        "panosoft/elm-utils": "2.0.0 <= v < 3.0.0",
        "panosoft/elm-cmd-retry": "3.0.0 <= v < 4.0.0",
        "panosoft/elm-parent-child-update": "2.0.0 <= v < 3.0.0",
        "elm-slate/command": "1.0.0 <= v < 2.0.0",
        "elm-slate/api": "2.0.0 <= v < 3.0.0",
        "elm-slate/common": "2.0.0 <= v < 3.0.0",
        "elm-slate/query": "2.0.0 <= v < 3.0.0",
        "guardian/entities": "1.0.0 <= v < 2.0.0",
        "guardian/session-api-common": "1.0.0 <= v < 2.0.0",
        "guardian/remote-api-common": "1.0.0 <= v < 2.0.0",
        "guardian/remote-api-client": "1.0.0 <= v < 2.0.0",
        "guardian/session-service-common": "1.0.0 <= v < 2.0.0"
    },
    "dependency-sources": {
        "guardian/entities": "[email protected]:guardian/entities",
        "guardian/session-api-common": "[email protected]:guardian/session-api-common",
        "guardian/remote-api-common": "[email protected]:guardian/remote-api-common",
        "guardian/remote-api-client": "[email protected]:guardian/remote-api-client",
        "guardian/session-service-common": "[email protected]:guardian/session-service-common"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

Add option to update one dependency

When I work on a project which consists of both a library and a program in separate git repos, a common workflow is to:

  1. add a feature to the library, commit and push it
  2. run elm-install in the program dir, to update the dependency
  3. use the new feature

However, step 2 takes a long time, because elm-install checks all the dependencies for updates. I specifically know that my own library has updated, and I am really only interested in updating that.

Would it be possible to add an option to check for updates for a specific dependency?

In the meantime, is there a quick way I can emulate this (eg. doing a 'git fetch' in ~/.elm-install/..., then a git checkout in elm-stuff/packages)?

Failed to resolve versions using on Windows

Running elm-github-install in my Elm project with only core and html as dependencies, I get this:

error { '0':
   Error: Unable to satisfy version constraint: elm-lang/core@>=5.0.0 <6.0.0 from root
       at C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\semver-resolver\lib\index.js:18
2:25
       at C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\lodash\lodash.js:4944:15
       at baseForOwn (C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\lodash\lodash.js:30
01:24)
       at Function.forOwn (C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\lodash\lodash.
js:13002:24)
       at SemverResolver.maxSatisfying (C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\s
emver-resolver\lib\index.js:164:24)
       at C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules\semver-resolver\lib\index.js:27
9:32
       at Array.forEach (native)
       at SemverResolver.resolveVersions (C:\Users\villasv\AppData\Roaming\npm\node_modules\elm-github-install\node_modules
\semver-resolver\lib\index.js:274:26)
       at process._tickCallback (internal/process/next_tick.js:103:7) }

elm-install fails with error: "\xC2" on US-ASCII.

following is the stacktrace obtained when executing elm-install --trace

/usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/ruby/lib/ruby/2.2.0/json/common.rb:155:in `encode': "\xC2" on US-ASCII (Encoding::InvalidByteSequenceError)
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/ruby/lib/ruby/2.2.0/json/common.rb:155:in `initialize'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/ruby/lib/ruby/2.2.0/json/common.rb:155:in `new'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/ruby/lib/ruby/2.2.0/json/common.rb:155:in `parse'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:134:in `json'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:35:in `dependency_sources'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:22:in `initialize'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:14:in `new'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:14:in `initialize'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `new'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `install'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/bin/elm-install:20:in `block (2 levels) in <top (required)>'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
        from /usr/local/share/.config/yarn/global/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-linux-x86_64/lib/vendor/ruby/2.2.0/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

Support for elm 0.19

Since Elm 0.19 is now released this should be updated to accommodate. It includes changes to the elm-package.json, one being it has been renamed to elm.json. It also seems to have some structural changes.

problem installing gatsby

Hi guys, please help me sort out this. I was running npm install --global gatsby-cli but it brough me this error.

Linux 4.15.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--global" "gatsby-cli" "--unsafe-perm=true" "--allow-root"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /home/giftnmtambo/npm-debug.log

Thanks
Gift.

Problem when running elm-install for the first time without having access to the repo.

So I had to setup a new PC to work with my existing elm projects, and I had forgotten to copy my .ssh key for accessing my repo before running elm-install, resulting in elm-install failing when fetching packages from my private repo.

The issue is that, once this happens, elm-install will then always fail when trying to fetch that specific package, because it tries to access the '.git' folder in the package's path but it does not exist.

The error it displays goes something like "path does not exist", and the path it tries to fetch, when we display it using --trace, is "C:/Users/myuser/.elm-install/my.repo.com/namespace/repo.git/.git".

The only way to fix this right now is to delete the package's folder, and re-run the command. Maybe the package's directory should not be created if it cannot be accessed? Or maybe the case where the .git folder is not existing should be handled as if the package has never been fetched. I feel like this error is a bit counter-intuitive.

Allow prerelease version tags

1.0.0 is reasonable for Elm
But to be consistent with npm semver style it's also advisable to be able to use 1.0.0-0
It'd help us with testing Elchemy a lot

npm install failing (Error: EACCES: permission denied, mkdir)

Hi,

I am having trouble installing this package globally. I run the following:

sudo npm install -g elm-github-install

and get the following:

npm WARN deprecated [email protected]: Use uuid module instead
/usr/local/bin/elm-github-install -> /usr/local/lib/node_modules/elm-github-install/scripts/run.js
/usr/local/bin/elm-install -> /usr/local/lib/node_modules/elm-github-install/scripts/run.js

> [email protected] install /usr/local/lib/node_modules/elm-github-install
> node scripts/install.js

Downloading and extracting the binary from: https://github.com/gdotdesign/elm-github-install/releases/download/v0.3.1/elm-install-0.3.1-osx.tar.gz
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: EACCES: permission denied, mkdir '/Users/alexandre/.elm-install'
    at Error (native)
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "elm-github-install"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the elm-github-install package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs elm-github-install
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls elm-github-install
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alexandre/Projects/elm-node/test/npm-debug.log

Thanks,
Alex

gem elm-install does not work

I have rubygems installed on my computer and when I tried to install elm-install, it didn't work. I got the following error message.

$> gem install elm-install
ERROR:  Could not find a valid gem 'elm-install' (>= 0) in any repository
ERROR:  Possible alternatives: elm_install

I looked at the Gemspec I and have found that the gem name is elm_install maybe you could correct the command name in the README.md file.

error: No such file or directory @ rb_sysopen - elm-stuff/exact-dependencies.json.

Whenever I try to run elm-install, I get that error. The gem installs fine.
Trace: Resolving packages... Solving dependencies... Traceback (most recent call last): 20: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/import.rb:5:in `block in <top (required)>' 19: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/delegates.rb:15:in `run!' 18: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/runner.rb:68:in `run!' 17: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/runner.rb:446:in `run_active_command' 16: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/command.rb:153:in `run' 15: from /home/jackfly26/.gem/ruby/2.6.0/gems/commander-4.4.7/lib/commander/command.rb:182:in `call' 14: from /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/bin/elm-install:20:in `block (2 levels) in <top (required)>' 13: from /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `install' 12: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method' 11: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with' 10: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to' 9: from /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/lib/elm_install/installer.rb:28:in `install' 8: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method' 7: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with' 6: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to' 5: from /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:22:in `populate' 4: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method' 3: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with' 2: from /home/jackfly26/.gem/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to' 1: from /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:30:in `write_exact_dependencies' /home/jackfly26/.gem/ruby/2.6.0/gems/elm_install-1.6.1/lib/elm_install/populator.rb:30:in `binwrite': No such file or directory @ rb_sysopen - elm-stuff/exact-dependencies.json (Errno::ENOENT)

Can we have an option so it won't clone already-existing/"official"/public packages (like elm-lang/core etc)?

That option would either skip all dependencies that already reside in ./elm-stuff/packages (but I guess wouldn't work well for package updates then?) or perhaps check the official package.elm-lang.org (I guess checking for 404 when hitting http://package.elm-lang.org/packages/FOO/BAR/latest might suffice).

I hoped the new --only-update would be a way to prevent elm-install from grabbing and "updating" all the official packages (where I'd want to stick to the elm-make repo sources really), but no dice!

[00:15 rox ~/c/e/mokka-app]$ elm-install install --only-update aforemny/elm-mdc
Resolving packages...
  ▶ Getting updates for: aforemny/elm-mdc
  ▶ Package: https://github.com/elm-lang/core not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/html not found in cache, cloning...
^C

Great tool though! =)

Installing via Yarn bin doesn't work

Maybe via npm also, I didn't check

On ubuntu 16.04

$ sudo apt install ruby
$ yarn add -D elm-github-install
$ node_modules/elm-github-install/bin/elm-install
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- commander/import (LoadError)
        from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from node_modules/elm-github-install/bin/elm-install:4:in `<main>'

No solution found: Unable to satisfy the following requirements

I have version 1.6.1 installed (as a Ruby gem) and there are two private packages hosted on our company's GitLab. I have a project running and the dependencies are installed ok but when I update one of the dependencies (bump the version, even create a tag for that version) and run elm-install, it ends with:

Solving dependencies...
  ▶ No solution found: Unable to satisfy the following requirements:

- `enectiva/entity-tree (< 2.0.0)` required by `user-specified dependency`
- `enectiva/entity-tree (>= 1.0.3)` required by `user-specified dependency`

When I check the cache in ~/.elm-install I can see that it is still at the previous version 1.0.2 (it's on the commit on master branch which is tagged as that version). However, when I list tags, it's aware of the new one:

git tag -l   
1.0.0
1.0.1
1.0.2
1.0.3

When I run git pull from the cache repository, everything works fine.

I assume, I'm doing something wrong, but what?

Contract violation on install of local packages

I'm receiving the following error when trying to install an Elm package that is on my local filesystem using a relative path. Using Ruby 2.4.1 and the latest version of elm-github-install.

Any thoughts?

error: Contract violation for argument 2 of 2:
        Expected: nil,
        Actual: "0.18"
        Value guarded in: ElmInstall::DirectorySource::versions
        With Contract: CollectionOf => CollectionOf
        At: PATH_TO_PROJECT/node_modules/elm-github-install/scripts/dist-1.4.0/elm-install-1.4.0-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.4.0/lib/elm_install/directory_source.rb:54 . Use --trace to view backtrace
Done

Error using protocol ssh://[user@]host.xz[:port]/path/to/repo.git/

elm $ elm-install -t
/Users/j/.nvm/versions/node/v7.10.0/lib/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/contracts-0.16.0/lib/contracts.rb:46:in `block in <class:Contract>': Contract violation for return value: (ReturnContractError)
        Expected: ElmInstall::Type,
        Actual: nil
        Value guarded in: ElmInstall::Identifier::uri_type
        With Contract: String, ElmInstall::Branch => ElmInstall::Type
        At: /Users/j/.nvm/versions/node/v7.10.0/lib/node_modules/elm-github-install/scripts/dist-1.6.1/elm-install-1.6.1-osx/lib/vendor/ruby/2.2.0/gems/elm_install-1.6.1/lib/elm_install/identifier.rb:116 

elm-install frequently fails when >1 build is run in parallel

I get this error a lot on my build server:

error: git '--git-dir=/var/lib/jenkins/.elm-install/github.com/elm-lang/html/.git' '--work-tree=/var/lib/jenkins/.elm-install/github.com/elm-lang/html' checkout '1.0.0'  2>&1:fatal: Unable to create '/var/lib/jenkins/.elm-install/github.com/elm-lang/html/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.. Use --trace to view backtrace

The problem is easy enough to work around by either:

  • Making parallel builds run sequentially
  • Containerizing every build to ensure they do not interfere with each other.

So perhpas it is unfair to rase this as an issue against elm-github-install?

But it would be nice if it were possible to have a centralized cache under ~/.elm-install and for parallel builds to be able to run.

Fails silently when github is unreachable

Running elm-github-install when github is unreachable (eg. when you are behind a corporate firewall), it does nothing and returns an error code of 0 (success).

$ elm-github-install

$ echo $?
0

Installs invalid version

Seems to be installing the incorrect version of my github hosted package. My elm-package.json specifies at least v0.0.13 of elm-firebase, but elm-github-install grabs 0.0.12 even though 0.0.13 is the current master! This computer has never seen the 0.0.12 library before so there was no cache.

My elm-package.json:

{
  "version": "1.0.0",
  "summary": "helpful summary of your project, less than 80 characters",
  "repository": "https://github.com/user/project.git",
  "license": "BSD3",
  "source-directories": ["src"],
    "exposed-modules": [],
    "dependencies": {
      -- SNIP --
      "pairshaped/elm-firebase": "0.0.13 <= v < 1.0.0"
    },
    "dependency-sources": {
      "pairshaped/elm-firebase": {
        "url": "https://github.com/pairshaped/elm-firebase",
        "ref": "master"
      }
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

Program output:

$ elm-github-install 
Resolving packages...
  ▶ Package: https://github.com/debois/elm-mdl not found in cache, cloning...
  ▶ Package: https://github.com/debois/elm-dom not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/core not found in cache, cloning...
  ▶ Package: https://github.com/evancz/elm-html not found in cache, cloning...
  ▶ Package: https://github.com/evancz/virtual-dom not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/html not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/virtual-dom not found in cache, cloning...
  ▶ Package: https://github.com/evancz/elm-effects not found in cache, cloning...
  ▶ Package: https://github.com/evancz/start-app not found in cache, cloning...
  ▶ Package: https://github.com/evancz/elm-markdown not found in cache, cloning...
  ▶ Package: https://github.com/debois/elm-parts not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/window not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/dom not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/mouse not found in cache, cloning...
  ▶ Package: https://github.com/elm-community/json-extra not found in cache, cloning...
  ▶ Package: https://github.com/elm-community/list-extra not found in cache, cloning...
  ▶ Package: https://github.com/elm-community/material-icons not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/svg not found in cache, cloning...
  ▶ Package: https://github.com/elm-community/maybe-extra not found in cache, cloning...
  ▶ Package: https://github.com/elm-community/string-extra not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/animation-frame not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/http not found in cache, cloning...
  ▶ Package: https://github.com/elm-lang/navigation not found in cache, cloning...
  ▶ Package: https://github.com/evancz/url-parser not found in cache, cloning...
  ▶ Package: https://github.com/pairshaped/elm-firebase not found in cache, cloning...
Solving dependencies...
Saving package cache...
  ● debois/elm-mdl - 8.1.0 (8.1.0)
  ● elm-community/json-extra - 2.1.0 (2.1.0)
  ● elm-community/list-extra - 4.0.0 (4.0.0)
  ● elm-community/material-icons - 1.1.0 (1.1.0)
  ● elm-community/maybe-extra - 3.1.0 (3.1.0)
  ● elm-community/string-extra - 1.3.3 (1.3.3)
  ● elm-lang/animation-frame - 1.0.1 (1.0.1)
  ● elm-lang/core - 5.1.1 (5.1.1)
  ● elm-lang/html - 2.0.0 (2.0.0)
  ● elm-lang/http - 1.0.0 (1.0.0)
  ● elm-lang/navigation - 2.1.0 (2.1.0)
  ● elm-lang/svg - 2.0.0 (2.0.0)
  ● evancz/elm-markdown - 3.0.2 (3.0.2)
  ● evancz/url-parser - 2.0.1 (2.0.1)
  ● pairshaped/elm-firebase - 0.0.12 (master)
  ● elm-lang/virtual-dom - 2.0.4 (2.0.4)
  ● elm-lang/dom - 1.1.1 (1.1.1)
  ● debois/elm-dom - 1.2.3 (1.2.3)
  ● elm-lang/mouse - 1.0.1 (1.0.1)
  ● elm-lang/window - 1.0.1 (1.0.1)
Packages configured successfully!

Unknown filetype

I am on MacOs Sierra and when I run the command I get the following error message:

error: unknown file type: /Users/me/.elm-install/github.com/elm-lang/html/./.git/tags.34360.

Here is the call stack

/Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1390:in `copy': unknown file type: /Users/me/.elm-install/github.com/elm-lang/keyboard/./.git/tags.35321 (RuntimeError)
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:469:in `block in copy_entry'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1500:in `call'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1500:in `wrap_traverse'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1503:in `block in wrap_traverse'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1502:in `each'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1502:in `wrap_traverse'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1503:in `block in wrap_traverse'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1502:in `each'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1502:in `wrap_traverse'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:466:in `copy_entry'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:441:in `block in cp_r'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1587:in `fu_each_src_dest0'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
	from /Users/me/.rubies/ruby-2.1.3/lib/ruby/2.1.0/fileutils.rb:440:in `cp_r'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/git_source.rb:63:in `copy_to'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/populator.rb:59:in `block in copy_dependencies'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/populator.rb:52:in `each'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/populator.rb:52:in `copy_dependencies'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/populator.rb:21:in `populate'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install/installer.rb:28:in `install'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_reference.rb:43:in `send_to'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/call_with.rb:79:in `call_with'
	from /Users/me/.gem/ruby/2.1.3/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in `block in redefine_method'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/lib/elm_install.rb:40:in `install'
	from /Users/me/.gem/ruby/2.1.3/gems/elm_install-1.6.1/bin/elm-install:20:in `block (2 levels) in <top (required)>'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/command.rb:178:in `call'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/command.rb:153:in `run'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/runner.rb:446:in `run_active_command'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/runner.rb:68:in `run!'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/delegates.rb:15:in `run!'
	from /Users/me/.gem/ruby/2.1.3/gems/commander-4.4.3/lib/commander/import.rb:5:in `block in <top (required)>'

I get the same error when using the npm version.

It seems that this error is not bound to a specific package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.