0

I would like to use jquery DataTables within my project. Since the package is not available in Packagist, I am trying to use composer to clone the git repo of DataTables but it fails. Please advise how to proceed:

{
"repositories": [
    {
        "type": "vcs",
        "url":  "https://github.com/DataTables/DataTables"
    }
],
"require": {
    "DataTables/DataTables": "master"
    }
}

Then composer update returns:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package datatables could not be found in any version, there
may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

I would further like to clone/download a specific version of the repo.

madth3
  • 7,275
  • 12
  • 50
  • 74
user1296490
  • 97
  • 1
  • 5
  • 13

2 Answers2

1

Old question and answer, however:

The error is not in the name of the package (that is indeed DataTables/DataTables) but in the indication of the stability. If you want the 'master' branch, you need to write 'dev-master' in composer and the stability level is dev. Otherwise require a specific tag. In your case:

{
    "repositories": [
        {
        "type": "vcs",
        "url":  "https://github.com/DataTables/DataTables"
        }
    ],
    "require": {
    "DataTables/DataTables": "dev-master"
    }
}

will work as expected:

root@erme:/usr/local/munk_php/jquerydatatables# composer install
Loading composer repositorInstalling dependencies (including require-dev)             
- Installing datatables/datatables (dev-master 96b7ef9)
Cloning 96b7ef9176543bbf1f1488c0f9538ad9dcc9bc01

Writing lock file
Generating autoload files
tribis
  • 101
  • 1
  • 5
0

The package name in https://github.com/DataTables/DataTables/blob/master/component.json isn't DataTables/DataTables

Try

"require": {
    "DataTables": "dev-master"
}