Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

How to install through composer #12

Open
atishgoswami opened this issue May 24, 2017 · 9 comments
Open

How to install through composer #12

atishgoswami opened this issue May 24, 2017 · 9 comments

Comments

@atishgoswami
Copy link

I tried to install the module using composer but as there is no composer.json on the root of the project throws error while installation.

Steps Taken:

composer config repositories.meanbee-royalmail git https://github.com/meanbee/magento2-royalmail.git
composer require meanbee/module-royalmail -vvv

Getting this error during installation:

Writing /home/vagrant/.composer/cache/repo/https---github.com-meanbee-magento2-royalmail.git/780ec5d96f9df1f2da83bcca299724ec30976ed4 into cache
Skipped branch use-short-config-path, no composer file
                                                                                                                                             
[Composer\Repository\InvalidRepositoryException]                                                                                               
No valid composer.json was found in any branch or tag of https://github.com/meanbee/magento2-royalmail.git, could not load a package from it.                                                                                                                                                

Exception trace:
 () at phar:///usr/bin/composer/src/Composer/Repository/VcsRepository.php:275
 Composer\Repository\VcsRepository->initialize() at phar:///usr/bin/composer/src/Composer/Repository/ArrayRepository.php:185
 Composer\Repository\ArrayRepository->getPackages() at phar:///usr/bin/composer/src/Composer/DependencyResolver/Pool.php:104
 Composer\DependencyResolver\Pool->addRepository() at phar:///usr/bin/composer/src/Composer/Command/InitCommand.php:596
 Composer\Command\InitCommand->getPool() at phar:///usr/bin/composer/src/Composer/Command/InitCommand.php:633
 Composer\Command\InitCommand->findBestVersionForPackage() at phar:///usr/bin/composer/src/Composer/Command/InitCommand.php:365
 Composer\Command\InitCommand->determineRequirements() at phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php:117
 Composer\Command\RequireCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:267
 Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:846
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:191
 Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:227
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:122
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:100
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:54
 require() at /usr/bin/composer:24

Please make the package composer friendly.

@bobbyshaw
Copy link
Member

Thanks @atishgoswami. This wasn't necessary when we were submitting to Magento Marketplace but we will now consider this after having removed it from there. I did recently come across this myself because I was looking to submit to package it. It is a low priority for me at the moment so if you fancy submitting a PR I'd be happy to review it. I think the main thing is the setup process will need to change a bit.

@munawar99
Copy link

@atishgoswami - did you have any luck creating composer.json?

@atishgoswami
Copy link
Author

@munawar99 Just checking on a few things I should have something to provide a pull request by tomorrow.

atishgoswami added a commit to atishgoswami/magento2-royalmail that referenced this issue Jun 1, 2017
@munawar99
Copy link

munawar99 commented Jun 4, 2017

Hi @atishgoswami

Thanks for providing this. I got this working and I'm posting this in case it helps anyone. It didn't work on PHP 5.6 due to a PHP bug where class names get mixed up but it worked on PHP 7.0:

Add to /composer.json:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/atishgoswami/magento2-royalmail"
}
],
"require": {
"meanbee/module-royalmail": "dev-php-composer-fixes"
}

and also:
minimum-stability: "dev"
}

composer require meanbee/module-royalmail -vvv

The next bit is a bit hazy because I had a problem with Magento not picking up the files. I copied the module's src/ files into their parent directory and edited the module's composer.json PSR-4 section to say "" instead of "src/". I'll need to revisit this later because I'm unsure what happened here, or why.

php bin/magento module:enable Meanbee_RoyalMail
php bin/magento setup:upgrade
php bin/magento setup:di:compile

@atishgoswami
Copy link
Author

@munawar99 Thanks for pointing that out I have made some changes to resolve the error.

@aasim110
Copy link

aasim110 commented Oct 6, 2017

I have installed extension successfully using COMPOSER, please try following steps for more information.

1 - make a directory /path/to/zipfiles/
2 - Create zip of /magento2-royalmail-master/src/ folder and rename with Royalmail-{packageversion}.zip
2 - drop Royalmail-{packageversion}.zip to that folder (/path/to/zipfiles/)
3 - go to magento root folder and : composer config repositories.meanbee-royalmail artifact /path/to/zipfiles/ 
4 - install the package : composer require "meanbee/module-royalmail:0.1.3"
5 - run following

php bin/magento module:enable Meanbee_RoyalMail;
php bin/magento setup:upgrade;
php bin/magento setup:di:compile;
php bin/magento cache:flush;

@MarkSyred
Copy link

@aasim110 Thanks for those instructions. However, they didn't work for me. Could it be because I am running the Magento installation on WAMP?

Anyway, I was able to follow instructions 1, 2, & 3 without error. Following instruction 4 produced this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for meanbee/module-royalmail 0.1.3 -> satisfiable by
meanbee/module-royalmail[0.1.3].
    - Conclusion: remove magento/framework 101.0.0
    - Conclusion: don't install magento/framework 101.0.0
    - meanbee/module-royalmail 0.1.3 requires magento/framework ^100.0.0 -> sati
sfiable by magento/framework[100.0.2, 100.0.3, 100.0.4, 100.0.5, 100.0.6, 100.0.
7, 100.0.8, 100.0.9, 100.1.0, 100.0.10, 100.0.11, 100.1.1, 100.0.12, 100.1.2, 10
0.1.3, 100.0.13, 100.1.4, 100.0.14, 100.1.5, 100.0.15, 100.1.6, 100.1.7, 100.0.1
6, 100.0.17, 100.1.8, 100.1.9, 100.0.18].


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

Any ideas how to fix this problem?

With kind regards,

Mark

@bedroomathletics
Copy link

Are there any clear guidelines as to how to install this extension? :(

@bobbyshaw
Copy link
Member

Sorry, we're no longer going to be supporting this extension. I'll leave this repository accessible for anyone that wants to make use of it but we aren't going to be actively developing it.

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

6 participants