Problem after update from 2.0.29 to 2.0.47

Hi, After I updated from to 2.0.47 my yii2 app throws:

# Invalid Argument – [yii\base\InvalidArgumentException](https://www.yiiframework.com/doc-2.0/yii-base-invalidargumentexception.html)

## The file or directory to be published does not exist: /srv/http/myapp/vendor/bower-asset/jquery/dist

* 1. in /srv/http/myapp/vendor/yiisoft/yii2/web/AssetManager.php

Here is my update process(after many tries):

composer update

output:


  Problem 1
    - yiisoft/yii2 dev-master requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> found bower-asset/inputmask[3.3.11] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - yiisoft/yii2[2.0.7, ..., 2.0.8] require bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> found bower-asset/jquery[3.2.1] but it does not match the constraint.
    - yiisoft/yii2[2.0.9, ..., 2.0.12.2] require bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] but it does not match the constraint.
    - yiisoft/yii2[2.0.13, ..., 2.0.15.1] require bower-asset/jquery 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - yiisoft/yii2[2.0.16, ..., 2.0.18] require bower-asset/jquery 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - yiisoft/yii2[2.0.19, ..., 2.0.35] require bower-asset/jquery 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - yiisoft/yii2[2.0.36, ..., 2.0.42.1] require bower-asset/jquery 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - yiisoft/yii2[2.0.43, ..., 2.0.x-dev] require bower-asset/jquery 3.6.*@stable | 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> found bower-asset/jquery[3.2.1] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
    - dpodium/yii2-filemanager dev-master requires yiisoft/yii2 2.0.* -> satisfiable by yiisoft/yii2[2.0.7, ..., 2.0.x-dev (alias of dev-master)].
    - yiisoft/yii2 2.0.x-dev is an alias of yiisoft/yii2 dev-master and thus requires it to be installed too.
    - Root composer.json requires dpodium/yii2-filemanager dev-master -> satisfiable by dpodium/yii2-filemanager[dev-master].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

rm composer.lock

composer require yidas/yii2-bower-asset

Now here is my composer.json

{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.7",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "lajax/yii2-language-picker": "1.*",
        "codemix/yii2-localeurls": "^1.5",
        "dpodium/yii2-filemanager": "dev-master",
        "pendalf89/yii2-filemanager": "*",
        "yiisoft/yii2-imagine": "^2.1",
        "yidas/yii2-bower-asset": "2.0.13.1"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "allow-plugins": {
            "yiisoft/yii2-composer" : true
        },
        "process-timeout": 1800,
        "fxp-asset": {
            "enabled": false
        }
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        },

        "repositories": [
            {
                "type": "composer",
                "url": "https://asset-packagist.org"
            }
        ]
    }
}

In my previous update to 2.0.29, I had to add to my config

'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],

Because there was a vendor/bower-asset folder, now there isn’t any more, but there is vendor/yidas/yii2-bower-asset/

I’m guessing here is the problem. but I do not know how to fix it.

I was able to install that list of packages in a fresh project with no issue, have you tried deleting your vendor directory / composer.lock and running composer install again?

1 Like

You have specified "yidas/yii2-bower-asset" in your composer.json, which claims to provide the missing packages in it’s own composer.json file. Thus composer will not install the packages anymore.

You could either remove the yidas/yii2-bower-asset package or check their readme and adjust your config as it is described there:

1 Like

Well, I removed composer.lock and the vendor folder, then I added new composer.json from a new install (+ my extensions), now it’s fixed. Thx all for your suggestions. :+1: