Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer new asset manager error #5107

Closed
johnluxor opened this issue Sep 19, 2014 · 33 comments
Closed

Composer new asset manager error #5107

johnluxor opened this issue Sep 19, 2014 · 33 comments
Milestone

Comments

@johnluxor
Copy link

Today, I decided execute composer update command, but get that errors

 [Composer\DependencyResolver\SolverProblemsException]                                                                          
    Problem 1                                                                                                                    
      - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[dev-master].                                      
      - yiisoft/yii2 dev-master requires bower-asset/jquery 1.11.* | 2.1.* -> no matching package found.                         
    Problem 2                                                                                                                    
      - Installation request for yiisoft/yii2-bootstrap * -> satisfiable by yiisoft/yii2-bootstrap[dev-master].                  
      - yiisoft/yii2-bootstrap dev-master requires bower-asset/bootstrap 3.2.* -> no matching package found.                     
    Problem 3                                                                                                                    
      - Installation request for yiisoft/yii2-jui * -> satisfiable by yiisoft/yii2-jui[dev-master].                              
      - yiisoft/yii2-jui dev-master requires bower-asset/jquery-ui 1.11.* -> no matching package found.    
@johnluxor johnluxor changed the title Composer not upload bower Composer new asset manager Sep 19, 2014
@johnluxor johnluxor changed the title Composer new asset manager Composer new asset manager error Sep 19, 2014
@githubjeka
Copy link
Contributor

#5083 (comment)

@francoispluchino
Copy link

Strange behavior, it is caused by the dependencies in the require-dev section. Move the dependencies in require and the solver arrives to solve the version correctly ...

@gimox
Copy link
Contributor

gimox commented Sep 19, 2014

same problem, but not solved...

@francoispluchino
Copy link

@gimox see #5083

@gimox
Copy link
Contributor

gimox commented Sep 19, 2014

the jquery problem came back....

The file or directory to be published does not exist: /var/www/html/app/vendor/bower/jquery/dist

@gimox
Copy link
Contributor

gimox commented Sep 19, 2014

solved adding
"bower-asset/jquery": "@stable",
jquery versin not stable hasn't "dist directory"

for a strange way...if i have some extension in require-dev, composer fail...

@gimox
Copy link
Contributor

gimox commented Sep 19, 2014

the bower bootstrap download the dev package it has many error in less now to solve it add in composer.json "bower-asset/bootstrap":"@stable".

@githubjeka
Copy link
Contributor

It is temporarily. Do not rush to be updated.

@cebe cebe added this to the 2.0 RC milestone Sep 19, 2014
@cebe
Copy link
Member

cebe commented Sep 19, 2014

@johnluxor please show your composer.json

@johnluxor
Copy link
Author

{
  "name": "sample/self",
  "description": "sample",
  "minimum-stability": "dev",
  "require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": "*",
    "yiisoft/yii2-bootstrap": "*",
    "yiisoft/yii2-swiftmailer": "*",
    "asofter/yii2-imperavi-redactor": "*",
    "yiisoft/yii2-imagine": "*",
    "2amigos/yii2-grid-view-library": "*",
    "2amigos/yii2-file-upload-widget": "*",
    "2amigos/yii2-date-time-picker-widget": "*",
    "2amigos/yii2-file-input-widget": "*",
    "2amigos/yii2-bootstrap-form-helpers-library": "*",
    "creocoder/yii2-nested-set-behavior": "*",
    "yiisoft/yii2-jui": "*",
    "2amigos/yii2-disqus-widget": "*",
  },
  "require-dev": {
    "yiisoft/yii2-codeception": "*",
    "yiisoft/yii2-debug": "*",
    "yiisoft/yii2-gii": "*"
  },
  "scripts": {
    "post-create-project-cmd": [
      "yii\\composer\\Installer::setPermission"
    ]
  },
  "config": {
    "process-timeout": 1800
  },
  "extra": {
    "writable": [
      "runtime",
      "web/media",
      "web/assets"
    ],
    "executable": [
      "yii"
    ],
    "asset-installer-paths": {
      "npm-asset-library": "vendor/npm",
      "bower-asset-library": "vendor/bower"
    }
  }
}

When I added

    "bower-asset/jquery": "@stable",
    "bower-asset/bootstrap": "@stable",
    "bower-asset/jquery-ui": "@stable",
    "bower-asset/jquery.inputmask": "@stable",
    "bower-asset/punycode": "@stable"

it solved my problem

@akaNightmare
Copy link

@johnluxor does not work

@t-tomek
Copy link

t-tomek commented Sep 19, 2014

@johnluxor worked for me 👍

@francoispluchino
Copy link

If you want to use the stable versions for assets, you must add the flag "@ stable" for each asset package, because the package root has a "minimum-stability" option on "dev".

@Shybko
Copy link
Contributor

Shybko commented Sep 20, 2014

@johnluxor worked for me too :)

@andrewblake1
Copy link

@johnluxor worked for me too, cheers

@ptheofan
Copy link

I had the same problem, like could no longer use composer as project would just collapse!

switched composer asset plugin to 1.0.0-beta1
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta1"

and then composer update works.
However the new issue was that the bower assets folder is now called bower-asset instead of bower.

So, I created an alias in the common/config/aliases.php (advanced template)
Yii::setAlias('@bower', dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'vendor/bower-asset');

and (unfortunately) had to edit a line in the Yii2 codebase
vendor/yiisoft/yii2/base/Application.php @ 452 (just commented it out).

When this is officially fixed (of if there's some other way to override the @bower alias) we can just uncomment the line.

Hope this helps.

@francoispluchino
Copy link

@ptheofan This change is doing in the config of composer.json file of Yii2 (see Define a custom directory for the assets installation for edit manually the config).

@francoispluchino
Copy link

A solution has been found (see fxpio/composer-asset-plugin#29).

Now the alias of a branch is added if:

  • $json['version'] is present
  • the version is a stable version
  • and that this version is not present in the list of tags
  • if the version is not a stable version, or the version is present in the list of tags, then the version will be prefixed with 'dev-'

@cebe
Copy link
Member

cebe commented Sep 22, 2014

Thanks @francoispluchino !

@cebe cebe closed this as completed Sep 22, 2014
@cebe
Copy link
Member

cebe commented Sep 22, 2014

I have also added the @stable tag to the application composer.json: 8176a39

@zqtsx
Copy link

zqtsx commented Sep 24, 2014

...

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

:(

  [Composer\DependencyResolver\SolverProblemsException]                                                              
    Problem 1                                                                                                        
      - yiisoft/yii2 dev-master requires bower-asset/jquery 2.1.*@stable | ~2.1@stable | ~1.11@stable -> no matching package found.                                                                                                   
      - yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.*@stable | ~2.1@stable | ~1.11@stable -> no matchingpackage found.                                                                                                    
      - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.x-dev, dev-master].               
  Potential causes:                                                                                                  
   - A typo in the package name                                                                                      
   - The package is not available in a stable-enough version according to your minimum-stability setting             
     see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.                   
  Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.                         

@githubjeka
Copy link
Contributor

@mdmunir
#5083 (comment)

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

@githubjeka do you mean this?

php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta1"

what the diferent with "fxp/composer-asset-plugin:1.0.*@dev"?

should i run it again?

@githubjeka
Copy link
Contributor

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

@githubjeka
It work, thanks. Just change to beta.

@francoispluchino
Copy link

@mdmunir have you this error with the most recent version ("dev") installed in global mode?

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

@francoispluchino
ya, i got that error. I should specify version of package to be work. eg bower-asset/jquery 2.1.1.

it is your component, right? good job, i like it 👍

@francoispluchino
Copy link

@mdmunir Can you give me your composer.json file, that I fixes this problem, please?

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

{
    "name": "sangkil/sangkilbiz3",
    "description": "Simple ERP",
    "keywords": ["yii2", "ERP"],
    "homepage": "http://www.sangkilsoft.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "authors": [
        {
            "name": "Mujib Masyhudi",
            "email": "mujib.masyhudi@gmail.com",
            "homepage": "http://www.sangkilsoft.com/",
            "role": "Founder and project lead"
        },
        {
            "name": "Misbahul Munir",
            "email": "misbahuldmunir@gmail.com",
            "role": "Core project development"
        }
    ],
    "support": {
        "issues": "https://github.com/sangkil/sangkilbiz3/issues?page=1&state=open",
        "source": "https://github.com/sangkil/sangkilbiz3"
    },
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-jui": "*",
        "mdmsoft/yii2-admin": "*",
        "mdmsoft/yii2-autonumber": "*",
        "mdmsoft/yii2-logger": "*",
        "mdmsoft/yii2-format-converter": "*",
        "mdmsoft/yii2-client-tools": "*",
        "mdmsoft/yii2-ar-behaviors": "*",
        "mdmsoft/yii2-widgets": "*"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*"
    },
    "suggest": {
        "codeception/codeception": "Codeception, 1.8.*@dev is currently works well with Yii.",
        "codeception/specify": "BDD style code blocks for PHPUnit and Codeception",
        "codeception/verify": "BDD Assertions for PHPUnit and Codeception",
        "yiisoft/yii2-faker": "Fixtures generator for Yii2 based on Faker lib",
        "yiisoft/yii2-mongodb": "Use for transaction logging"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

mdmsoft/* has no required bower

@francoispluchino
Copy link

@mdmunir I just tested, and everything is OK. I think your Composer does not use the latest version dev of my plugin (and also Composer).

Commands executed:

$ composer selfupdate
$ composer global require fxp/composer-asset-plugin:@dev

You can also update your global dependencies:

$ composer global update

And I get:

$ composer install --prefer-dist
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing yiisoft/yii2-composer (dev-master 0128e4a)
    Downloading: 100%
    Extracting archive

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

  - Installing bower-asset/yii2-pjax (v2.0.0)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/punycode (v1.3.1)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/jquery.inputmask (3.x-dev 836b4e5)
    Downloading: 100%
    Extracting archive

  - Installing cebe/markdown (0.9.x-dev 6a3c373)
    Downloading: 100%
    Extracting archive

  - Installing ezyang/htmlpurifier (v4.6.0)
    Downloading: 100%
    Extracting archive

  - Installing yiisoft/yii2 (dev-master af7ee57)
    Downloading: 100%
    Extracting archive

  - Installing phpspec/php-diff (dev-master 30e103d)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-autonumber (dev-master d357c7a)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-logger (dev-master e307c74)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-format-converter (dev-master 9db2719)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-client-tools (dev-master 7abb733)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-ar-behaviors (dev-master dac5a4c)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-widgets (dev-master d2b8a18)
    Downloading: 100%
    Extracting archive

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

  - Installing yiisoft/yii2-jui (dev-master b6ec81d)
    Downloading: 100%
    Extracting archive

  - Installing mdmsoft/yii2-admin (dev-master 61dcf6c)
    Downloading: 100%
    Extracting archive

  - Installing yiisoft/yii2-codeception (dev-master 2f7a70f)
    Downloading: 100%
    Extracting archive

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

  - Installing yiisoft/yii2-bootstrap (dev-master f295f15)
    Downloading: 100%
    Extracting archive

  - Installing yiisoft/yii2-debug (dev-master ae57c50)
    Downloading: 100%
    Extracting archive

  - Installing bower-asset/typeahead.js (v0.10.5)
    Downloading: 100%
    Extracting archive

  - Installing yiisoft/yii2-gii (dev-master 7858501)
    Downloading: 100%
    Extracting archive

mdmsoft/yii2-logger suggests installing yiisoft/yii2-mongodb (Use for mongo storage)
Writing lock file
Generating autoload files

@mdmunir
Copy link
Contributor

mdmunir commented Sep 25, 2014

@francoispluchino
Sory, may be its my fault. I run

php composer.phar global require "fxp/composer-asset-plugin:1.0.*@dev"

more than week ago. I dont see @dev here, so i dont have initiative to update it 😀 .
I will update it to dev again. thanks.

@he11d0g
Copy link

he11d0g commented Dec 29, 2015

@francoispluchino
Thx ;)

@yiisoft yiisoft locked and limited conversation to collaborators Dec 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests