luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
811 stars 205 forks source link

[Install] Composer error #2150

Closed neoacevedo closed 1 year ago

neoacevedo commented 2 years ago

What steps will reproduce the problem?

composer create-project luyadev/luya-kickstarter:^1.0

What is the expected result?

A normal installation of Luya.

What do you get instead? (A Screenshot can help us a lot!)

Similar to https://github.com/luyadev/luya/issues/1801 in Windows but having composer-asset-plugin as global require.

Windows Console output ```sh composer create-project luyadev/luya-kickstarter:^1.0 luyacms The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. Creating a "luyadev/luya-kickstarter:1.0" project at "./luyacms" The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. Info from https://repo.packagist.org: #StandWithUkraine Installing luyadev/luya-kickstarter (1.0.0) - Downloading luyadev/luya-kickstarter (1.0.0) - Installing luyadev/luya-kickstarter (1.0.0): Extracting archive Created project in C:\Users\Usuario\public_html\luyacms The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. Loading composer repositories with package information Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - yiisoft/yii2-gii[2.0.0, ..., 2.0.4] require bower-asset/typeahead.js 0.10.* -> could not be found in any version, but the following packages provide it: - 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 - craftcms/yii2-dynamodb Yii2 implementation of a cache, session, and queue driver for DynamoDB - lsat/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE - myzero1/yii2-app-advanced Yii 2 Advanced Project Template - blackhive/yii2-app-advanced Yii 2 Advanced Project Template - cliff363825/yii2-bower-asset Yii2 bower asset - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset - pixelandtonic/yii2-dynamodb Yii2 implementation of a cache, session, and queue driver for DynamoDB - projectchina/yii2-app-advanced Yii 2 Advanced Project Template - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template Consider requiring one of these to satisfy the bower-asset/typeahead.js requirement. - yiisoft/yii2-gii[2.0.5, ..., 2.0.8] require bower-asset/typeahead.js 0.10.* | ~0.11.0 -> could not be found in any version, but the following packages provide it: - 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 - craftcms/yii2-dynamodb Yii2 implementation of a cache, session, and queue driver for DynamoDB - lsat/yii2-bower-asset Bower Assets for Yii 2 app provided via Composer repository - kriss/yii2-advanced Yii2 advanced project template, Frontend for API and Backend with AdminLTE - myzero1/yii2-app-advanced Yii 2 Advanced Project Template - blackhive/yii2-app-advanced Yii 2 Advanced Project Template - cliff363825/yii2-bower-asset Yii2 bower asset - maiscrm/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset - pixelandtonic/yii2-dynamodb Yii2 implementation of a cache, session, and queue driver for DynamoDB - projectchina/yii2-app-advanced Yii 2 Advanced Project Template - stiks/yii2-composer-bower-skip A Composer package that allows you to install or update Yii2 without Bower-Asset - tanakahisateru/yii2-app-basic-npm How to use NPM with Yii 2 Basic Application Template Consider requiring one of these to satisfy the bower-asset/typeahead.js requirement. - Root composer.json requires yiisoft/yii2-gii ~2.0.0 -> satisfiable by yiisoft/yii2-gii[2.0.0, ..., 2.0.8]. 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 for more details. - It's a private package and you forgot to add a custom repository to find it Read for further common problems. ```

In Linux, the output is a little bit different:

Linux Console output ```sh composer create-project luyadev/luya-kickstarter:^1.0 luyacms Creating a "luyadev/luya-kickstarter:^1.0" project at "./luyacms" Info from https://repo.packagist.org: #StandWithUkraine Installing luyadev/luya-kickstarter (1.1.7) - Downloading luyadev/luya-kickstarter (1.1.7) - Installing luyadev/luya-kickstarter (1.1.7): Extracting archive Created project in /home/Usuario/Público/luyacms Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - phpspec/prophecy is locked to version 1.13.0 and an update of this package was not requested. - phpspec/prophecy 1.13.0 requires php ^7.2 || ~8.0, <8.1 -> your php version (8.1.7) does not satisfy that requirement. Problem 2 - phpspec/prophecy 1.13.0 requires php ^7.2 || ~8.0, <8.1 -> your php version (8.1.7) does not satisfy that requirement. - phpunit/phpunit 8.5.19 requires phpspec/prophecy ^1.10.3 -> satisfiable by phpspec/prophecy[1.13.0]. - phpunit/phpunit is locked to version 8.5.19 and an update of this package was not requested. ```

LUYA Check ouput (run this script and post the result: luyacheck.php)

I'm running it in a docker image where previously I download/install the project and after it I run it as a mapped storage, so, apache_get_modules won't work.

1: [ini_get('short_open_tag')] '' 2: [ini_get('error_reporting')] '' 3: [phpversion()] '8.0.8' 4: [php_ini_loaded_file()] false 5: [php_sapi_name()] 'fpm-fcgi' 6: [isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : unknown] 'Apache/2.4.38 (Debian)'

Additional infos

Q A
LUYA Version
PHP Version 8.0
Platform Apache/PHP-FPM
Operating system Windows/Linux
nadar commented 2 years ago

Hi @neoacevedo, thanks for the report. I have removed the composer.lock file, you can try again. I just checked the linux report from your report because it states Your lock file does not contain a compatible set of packages. Please run composer update. so you could just run composer update

neoacevedo commented 2 years ago

Yes, but now I get another error:

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

nadar commented 2 years ago

even if you start a clean project? The Yii Framework requires that dependency and its handled via https://asset-packagist.org. What version of composer do you have? You get that error when you try to run the website? What does your vendor contain, there must be a bower folder or similar? Have you changed something in the config (i don't think so, but just asking).

So you get that error after which step of the installation?

neoacevedo commented 2 years ago

Yes, in a clean project. I have tried with composer 1.4 and composer 2.0 with the exact same result.

imagen

Changing something? No, I just run the commands and after that I try to run the website.

This error I get just after last step of installation when I try to run the website.

My guess is on this part of composer.json:

        "asset-installer-paths": {
            "bower-asset-library": "vendor/bower"
        },

The bower directory inside vendor is bower-asset.

UPDATE:

In env-local.php I have configured the aliases just like any yii2 config.php template:

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

It did the trick.

nadar commented 2 years ago

@neoacevedo thanks for the update. but i assume its the same problem as #2151, this alias definition is available in the config.php of latest kickstarter and env-local.php is not used anymore. Check this folder (https://github.com/luyadev/luya-kickstarter/tree/master/configs) in latest kickstarter, we only have a single config.php - so you have installed a very old version of the kickstarter even though your composer create project commands looks absolute correctly.

nadar commented 1 year ago

I am going to close this issue because:

If you think this is still important or there are more/new informations. Please reopen the issue and let us know.

If this is a problem or a feature you like to discuss, join our discussion: LUYA discussions. We try to keep our issue tracker as clean as possible in order to focus on active issues.