Any Pro who can help me to upgrade version 2.0.18 under development to 2.0.39?

I have a project which stay with 2 years ago with version 2.0.18 under development, and now trying to keep running it but need to upgrade to the latest version for Yii2 which can be prepared for Yii3 in the future, When do upgrading, Errors always coming up, so try to find help from here to see if this can be fix or not. Thank you!

error logs:

    Problem 1
    - Root composer.json requires yiisoft/yii2 ~2.0.39.3 -> satisfiable by yiisoft/yii2[2.0.39.3].
    - yiisoft/yii2 2.0.39.3 requires 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 -> could not be found in any version, but the following packages provide it:
      - craftcms/cms Craft CMS
      - yidas/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository
      - yidas/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - yidas/yii2-jquery jQuery Asset Bundle extension with fixed and CDN sources for Yii2 framework
      - jamband/yii2-ensure-unique-behavior This extension insert unique identifier automatically for the Yii 2 framework
      - taobig/php-helper A tool set for PHP projects
      - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - demokn/yii2-composer-asset
      - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - blackhive/yii2-app-advanced Yii 2 Advanced Project Template
      - cliff363825/yii2-bower-asset Yii2 bower asset
      - getdkan/recline recline.js module for DKAN/Drupal
      - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE
      - maniakalen/tags Yii2 Element tags integration module
      - myzero1/yii2-app-advanced Yii 2 Advanced Project Template
      - onyijne/ovy Onsen-UI 2 + Vue.js 2 + Yii2 Basic Project Template
      - projectchina/yii2-app-advanced Yii 2 Advanced Project Template
      - success/yii2-app-api Yii2 Api Application Template
      - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template
      - yuncms/framework The Yuncms Framework.
      Consider requiring one of these to satisfy the bower-asset/jquery requirement.
  Problem 2
    - yiisoft/yii2-bootstrap[2.0.0-alpha, ..., 2.0.0-beta] require yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.39.3].
    - yiisoft/yii2-bootstrap[dev-master, 2.0.9, ..., 2.0.10] require bower-asset/bootstrap 3.4.* | 3.3.* | 3.2.* | 3.1.* -> could not be found in any version, but the following packages provide it:
      - craftcms/cms Craft CMS
      - yidas/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository
      - yidas/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - taobig/php-helper A tool set for PHP projects
      - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - demokn/yii2-composer-asset
      - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - blackhive/yii2-app-advanced Yii 2 Advanced Project Template
      - cliff363825/yii2-bower-asset Yii2 bower asset
      - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE
      - myzero1/yii2-app-advanced Yii 2 Advanced Project Template
      - projectchina/yii2-app-advanced Yii 2 Advanced Project Template
      - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template
      - yidas/yii2-bootstrap Bootstrap Asset Bundle extension for Yii2 framework
      Consider requiring one of these to satisfy the bower-asset/bootstrap requirement.
    - yiisoft/yii2-bootstrap[2.0.0-rc, ..., 2.0.0] require bower-asset/bootstrap 3.2.* | 3.1.* -> could not be found in any version, but the following packages provide it:
      - craftcms/cms Craft CMS
      - yidas/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository
      - yidas/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - taobig/php-helper A tool set for PHP projects
      - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - demokn/yii2-composer-asset
      - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - blackhive/yii2-app-advanced Yii 2 Advanced Project Template
      - cliff363825/yii2-bower-asset Yii2 bower asset
      - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE
      - myzero1/yii2-app-advanced Yii 2 Advanced Project Template
      - projectchina/yii2-app-advanced Yii 2 Advanced Project Template
      - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template
      - yidas/yii2-bootstrap Bootstrap Asset Bundle extension for Yii2 framework
      Consider requiring one of these to satisfy the bower-asset/bootstrap requirement.
    - yiisoft/yii2-bootstrap[2.0.1, ..., 2.0.8] require bower-asset/bootstrap 3.3.* | 3.2.* | 3.1.* -> could not be found in any version, but the following packages provide it:
      - craftcms/cms Craft CMS
      - yidas/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository
      - yidas/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - taobig/php-helper A tool set for PHP projects
      - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - demokn/yii2-composer-asset
      - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - blackhive/yii2-app-advanced Yii 2 Advanced Project Template
      - cliff363825/yii2-bower-asset Yii2 bower asset
      - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE
      - myzero1/yii2-app-advanced Yii 2 Advanced Project Template
      - projectchina/yii2-app-advanced Yii 2 Advanced Project Template
      - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template
      - yidas/yii2-bootstrap Bootstrap Asset Bundle extension for Yii2 framework
      Consider requiring one of these to satisfy the bower-asset/bootstrap requirement.
    - yiisoft/yii2 2.0.39.3 requires 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 -> could not be found in any version, but the following packages provide it:
      - craftcms/cms Craft CMS
      - yidas/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository
      - yidas/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - yidas/yii2-jquery jQuery Asset Bundle extension with fixed and CDN sources for Yii2 framework
      - jamband/yii2-ensure-unique-behavior This extension insert unique identifier automatically for the Yii 2 framework
      - taobig/php-helper A tool set for PHP projects
      - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - demokn/yii2-composer-asset
      - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset
      - blackhive/yii2-app-advanced Yii 2 Advanced Project Template
      - cliff363825/yii2-bower-asset Yii2 bower asset
      - getdkan/recline recline.js module for DKAN/Drupal
      - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE
      - maniakalen/tags Yii2 Element tags integration module
      - myzero1/yii2-app-advanced Yii 2 Advanced Project Template
      - onyijne/ovy Onsen-UI 2 + Vue.js 2 + Yii2 Basic Project Template
      - projectchina/yii2-app-advanced Yii 2 Advanced Project Template
      - success/yii2-app-api Yii2 Api Application Template
      - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template
      - yuncms/framework The Yuncms Framework.
      Consider requiring one of these to satisfy the bower-asset/jquery requirement.
    - yiisoft/yii2-bootstrap 2.0.x-dev is an alias of yiisoft/yii2-bootstrap dev-master and thus requires it to be installed too.
    - Root composer.json requires yiisoft/yii2-bootstrap ~2.0.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0-alpha, ..., 2.0.x-dev (alias of 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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

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

Installation failed, reverting ./composer.json to its original content.

Are you using https://asset-packagist.org/ ?

1 Like

Thank you very much for replying this @Bizley !
Well, I’m not so sure as this website was maintained by a partner which he’s dead now, and I’m not really familiar with Yii but it’s running really fast even faster than Laravel, I can see that. So decided to keep it running on. but you know 2.0.18 is a little bit old now. If you would like to help that I can provide you the server access info and really appreciate for this for you, Thanks again!

Could you share your composer.json?

Sure, of course I can:

   {
    "name": "yiisoft/yii2-app-advanced",
    "description": "Yii 2 Advanced Application Template",
    "keywords": ["yii2", "framework", "advanced", "application 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",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.6",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0",
        "yiisoft/yii2-jui": "~2.0.0",
		"yiisoft/yii2-imagine": "~2.1.0",
		"php-ffmpeg/php-ffmpeg": "dev-master",
        "yiisoft/yii2-redis": "~2.0.0",
        "kartik-v/yii2-widget-datetimepicker": "@dev",
        "kartik-v/yii2-widget-datepicker": "@dev",
        "kartik-v/yii2-date-range": "dev-master",
		"henter/wechat-oauth": "dev-master",
        "aliyuncs/oss-sdk-php": "~2.0"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.0.0",
        "yiisoft/yii2-gii": "~2.0.0",
        "yiisoft/yii2-faker": "~2.0.0",
        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

I have a couple of solutions for you, just recommend testing well in a controlled environment, before going to production:

Try this first at project folder:

composer global require "fxp/composer-asset-plugin:^1.2.0"
composer update

If still getting the error, try cleaning your composer:

rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:^1.2.0"
composer install
composer update

This solution is a modified version from a response to a Stack Overflow question.

Another solution could adding the yidas package, as provided by packagist, just add this to your composer.json require:

"yidas/yii2-bower-asset":"*",

One thing that I noted is that you are using lots of “dev” packages, which requires you to set "minimum-stability": "dev",.

If possible, try using the latest stable version of those packages, so that you can set your minimum-stability to stable.

1 Like

No, no, please don’t use fxp/composer-asset-plugin. Add this in your composer.json:

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

Thank you so much for replying this Bruno, It works with "yidas/yii2-bower-asset":"*", and what about “minimum-stability”: “dev”? Just need to change “dev” to “stable” ? or something will make that switch to stable version, although not sure why my partner set it with dev one but all good now and all I want is to use it with stable version in my production website. And also really appreciate it You @Bizley for your reply with https://asset-packagist.org repo, will look into it more for asset-packagist.org, Thanks a million you guys are awesome!!! Nope! You are not just guys, but the Pros! Thank YOU!

1 Like

@Bizley is correct abou the package, sorry about my mistake. Just make sure you use the assets-packagist.

For the minimum-stability, you will have to update this option to “stable” and update the packages that depends on “dev” versions, like "kartik-v/yii2-widget-datetimepicker", to their stable versions.

The other guy might be using them because by the time they might’ve had some featured in development that he wanted. Just make sure that this updates don’t break your app before releasing to production.