fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
892 stars 156 forks source link

Composer InvalidArgumentException #167

Closed webphppro closed 8 years ago

webphppro commented 8 years ago

Plugin version 1.1.1 composer 'minimum-stability': 'stable'

When I use require like

"require": {
    ...
    "bower-asset/package_name": "*",
    ...
 }

for some of packages I get an exception like:

[InvalidArgumentException] Package bower-asset/fuelux--9999999.9999999.9999999.9999999 must have a source or dist specified

"require": {
    ...
    "bower-asset/package_name": "dev-master",
    ...
 }

works okay

cebe commented 8 years ago

can you give a concreate example with which package this happens?

webphppro commented 8 years ago

I tried to install

"require": { "bower-asset/jquery-ui": "", "bower-asset/angular": "", "bower-asset/angular-resource": "", "bower-asset/angular-sanitize": "", "bower-asset/angular-animate": "", "bower-asset/angular-ui-router": "", "bower-asset/angular-google-maps": "dev-master", "bower-asset/restangular": "", "bower-asset/google-maps": "", "bower-asset/angular-bootstrap": "", "bower-asset/angular-easyfb": "", "bower-asset/angular-google-plus": "", "bower-asset/pace": "", "bower-asset/fastclick": "", "bower-asset/jquery-color": "", "bower-asset/select2": "", "bower-asset/summernote": "", "bower-asset/he": "", "bower-asset/to-markdown": "", "bower-asset/markdown": "", "bower-asset/bootstrap-markdown": "", "bower-asset/ckeditor": "", "bower-asset/moment": "", "bower-asset/moment-timezone": "", "bower-asset/bower-jquery-sparkline": "", "bower-asset/jquery.easy-pie-chart": "", "bower-asset/flot": "", "bower-asset/raphael": "", "bower-asset/morrisjs": "", "bower-asset/dygraphs": "", "bower-asset/chartjs": "", "bower-asset/datatables": "", "bower-asset/datatables-bootstrap3": "dev-master", "bower-asset/datatables-tabletools": "", "bower-asset/datatables-colvis": "", "bower-asset/datatables-responsive": "", "bower-asset/jqgrid": "", "bower-asset/jquery-maskedinput": "", "bower-asset/jquery-validation": "", "bower-asset/jquery-form": "", "bower-asset/bootstrap-validator": "", "bower-asset/bootstrap-timepicker": "", "bower-asset/clockpicker": "", "bower-asset/nouislider": "", "bower-asset/ion.rangeSlider": "", "bower-asset/bootstrap-duallistbox": "", "bower-asset/jquery-knob": "", "bower-asset/seiyria-bootstrap-slider": "", "bower-asset/bootstrap-tagsinput": "", "bower-asset/x-editable": "", "bower-asset/dropzone": "", "bower-asset/jcrop": "", "bower-asset/bootstrap-progressbar": "", "bower-asset/jquery-nestable-bower": "dev-master", "bower-asset/superbox": "", "bower-asset/jvectormap-2.0.2": "dev-master", "bower-asset/lodash": "", "bower-asset/magnific-popup": "", "bower-asset/json3": "", "bower-asset/es5-shim": "", "bower-asset/xaguilars-bootstrap-colorpicker": "*", "bower-asset/fuelux": "dev-master" }

"bower-asset/angular-google-maps" : "*",
"bower-asset/datatables-bootstrap3" : "*",
"bower-asset/jquery-nestable-bower" : "*",
"bower-asset/jvectormap-2.0.2": "*",
"bower-asset/fuelux": "*"

raised the Exception above

francoispluchino commented 8 years ago

Because the plugin is not installed in global mode. I know, the message isn't clear, because the plugin isn't installed before the installation of dependencies. And so, it's Composer that throws an error, not the plugin.

And also, it's not recommended to use the wildcard, because Composer will get all versions for each packages, and the plugin can not optimize this process. In the end, it will be very long.

With your example:

$ composer global require fxp/composer-asset-plugin:@stable
{
    "require": {
        "bower-asset/fuelux": "*"
    }
}
$ composer install --prefer-dist
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing bower-asset/moment (2.10.6)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/jquery (2.1.4)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/bootstrap (v3.3.5)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/requirejs (2.1.22)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/fuelux (3.12.0)
    Downloading: 100%
    Extracting archive

Writing lock file
Generating autoload files
webphppro commented 8 years ago

I'm not sure if this issue is connected to the plugin or not. I surely have plugin installed globally. OS: Windows 8.1

my composer.json:

{ "require": { "bower-asset/angular-google-maps": "", "bower-asset/bower-jquery-sparkline": "" }, "extra": { "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } } }

C:\vhost\test>composer install Loading composer repositories with package information Installing dependencies (including require-dev) Reading bower.json of bower-asset/angular-google-maps (2.2.1)Your GitHub credentials are required to fetch private repository metadata (http://github.com/LiosK/UUID.js/archive/v3.2.tar.gz) Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+****+2015-11-22+2003 to retrieve a token. It will be stored in "C:/Users/****/AppData/Roaming/Composer/auth.json" for future use by Composer. Token (hidden): Token stored successfully.

[InvalidArgumentException] Package bower-asset/bower-jquery-sparkline--9999999.9999999.9999999.9999999 must have a source or dist specified