dmstr / yii2-adminlte-asset

AdminLTE Asset Bundle for Backend Theme in Yii2 Framework
1.14k stars 425 forks source link

Unable to install version2 through composer. Getting rmrevin/yii2-fontawesome Invalid version string "v4.1.*" #76

Closed re3lex closed 8 years ago

re3lex commented 8 years ago

Hi,

I'm trying to install version 2 through composer but getting this error

g:\projects\WebApp>composer require dmstr/yii2-adminlte-asset "2.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

  [RuntimeException]
  Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.*:
   Invalid version string "v4.1.*"

  [UnexpectedValueException]
  Could not parse version constraint v4.1.*: Invalid version string "v4.1.*"
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [packages1] ... [packagesN]

How to get yii2-adminlte-asset installed?

schmunk42 commented 8 years ago

Check your error message:

Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.*:
   Invalid version string "v4.1.*"

Looks like you have that in your composer.json

Or check it with depends

$ composer depends rmrevin/yii2-fontawesome
dmstr/yii2-adminlte-asset requires rmrevin/yii2-fontawesome (~2.9)

It's not a problem of adminlte-asset

composer require dmstr/yii2-adminlte-asset "2.*"
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing yiisoft/yii2-composer (2.0.3)               
    Loading from cache

  - Installing bower-asset/jquery (2.1.4)
    Loading from cache

  - Installing bower-asset/yii2-pjax (v2.0.5)
    Loading from cache

  - Installing bower-asset/punycode (v1.3.2)
    Loading from cache

  - Installing bower-asset/jquery.inputmask (3.1.63)
    Loading from cache

  - Installing cebe/markdown (1.1.0)
    Loading from cache

  - Installing ezyang/htmlpurifier (v4.6.0)
    Loading from cache

  - Installing yiisoft/yii2 (2.0.6)
    Loading from cache

  - Installing bower-asset/fontawesome (v4.5.0)
    Loading from cache

  - Installing rmrevin/yii2-fontawesome (2.13.0)
    Loading from cache

  - Installing almasaeed2010/adminlte (v2.3.2)
    Loading from cache

  - Installing cebe/yii2-gravatar (1.1)
    Loading from cache

  - Installing bower-asset/bootstrap (v3.3.5)
    Loading from cache

  - Installing yiisoft/yii2-bootstrap (2.0.5)
    Loading from cache

  - Installing dmstr/yii2-adminlte-asset (2.2.4)
    Loading from cache

Writing lock file
Generating autoload files
schmunk42 commented 8 years ago

Also make sure to have:

fxp/composer-asset-plugin         v1.1.1
re3lex commented 8 years ago

hi schmunk42 thanks for your input I will check my local

re3lex commented 8 years ago

looks like some issue in composer's cache This helped

composer self-update
apps25 commented 7 years ago

Hi @schmunk42 composer require dmstr/yii2-adminlte-asset "2.*" ./composer.json has been created is not working in my case.

$ composer depends rmrevin/yii2-fontawesome yiister/yii2-gentelella requires rmrevin/yii2-fontawesome (~2.0)

$ composer require yiister/yii2-gentelella Using version ^1.3 for yiister/yii2-gentelella ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)

[RuntimeException]
Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.
: Invalid version string "v4.1."

[UnexpectedValueException]
Could not parse version constraint v4.1.: Invalid version string "v4.1."

schmunk42 commented 7 years ago

@apps25

[RuntimeException]
Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.
: Invalid version string "v4.1."

Please double-check where the invalid version string for yii2-fontawesome is coming from. We're requiring ~2.9 https://github.com/dmstr/yii2-adminlte-asset/blob/master/composer.json#L22 - does not look like an issue with this repo.

apps25 commented 7 years ago

Hi @schmunk42 Thanks for reply, I want to clear that this problem is at Live project I was going through a blog and trying to resolve the error but now i am facing this issue. my installed composer is : Composer version 1.0-dev (9f6fdfd703f433bd0777fd89fb4684908a6c4f06) 2015-09-07 and after running diagnose command i am getting:

Checking composer.json: FAIL require.yiisoft/yii2 : unbound version constraints (>=2.0.6) should be avoided require.yiisoft/yii2-bootstrap : unbound version constraints () should be avoided require.yiisoft/yii2-swiftmailer : unbound version constraints () should be avoided require.yiisoft/yii2-imagine : unbound version constraints () should be avoided require.bupy7/yii2-activerecord-history : unbound version constraints () should be avoided require.linslin/yii2-curl : unbound version constraints () should be avoided require.yii2mod/yii2-bx-slider : unbound version constraints () should be avoided require.FortAwesome/Font-Awesome : unbound version constraints () should be avoided require.jenn0pal/yii2-aws-sdk : unbound version constraints () should be avoided Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: OK Checking disk free space: OK Checking composer version: FAIL You are not running the latest version

====================================================== and after running composer validate:

./composer.json is valid, but with a few warnings See https://getcomposer.org/doc/04-schema.md for details on the schema The lock file is not up to date with the latest changes in composer.json. require.yiisoft/yii2 : unbound version constraints (>=2.0.6) should be avoided require.yiisoft/yii2-bootstrap : unbound version constraints () should be avoided require.yiisoft/yii2-swiftmailer : unbound version constraints () should be avoided require.yiisoft/yii2-imagine : unbound version constraints () should be avoided require.bupy7/yii2-activerecord-history : unbound version constraints () should be avoided require.linslin/yii2-curl : unbound version constraints () should be avoided require.yii2mod/yii2-bx-slider : unbound version constraints () should be avoided require.FortAwesome/Font-Awesome : unbound version constraints () should be avoided require.jenn0pal/yii2-aws-sdk : unbound version constraints () should be avoided

composer update --lock Loading composer repositories with package information Updating dependencies (including require-dev)

[RuntimeException]
Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.
: Invalid version string "v4.1."

[UnexpectedValueException]
Could not parse version constraint v4.1.: Invalid version string "v4.1."

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]

schmunk42 commented 7 years ago

@apps25 Please format your output, see https://help.github.com/articles/basic-writing-and-formatting-syntax/ - important parts are not shown correctly like *

Secondly, update your composer binary, your version is over 2 years old Composer version 1.0-dev (9f6fdfd703f433bd0777fd89fb4684908a6c4f06) 2015-09-07 - and clear your caches, like mentioned in https://github.com/dmstr/yii2-adminlte-asset/issues/76#issuecomment-164175420

Thirdly, never ever use update in production, commit a .lock file and run install.

Last but not least, I still don't see why this should be an issue of yii2-adminlte-asset.

apps25 commented 7 years ago

@schmunk42
I got it thanks :+1: