I'm trying to use https://github.com/consolibyte/quickbooks-php in a Drupal 8 project. I think I've followed composer ways of adding it:
composer config repositories.quickbooks-php vcs https://github.com/consolibyte/quickbooks-php
composer require "consolibyte/quickbooks-php master"
But the 2nd command returns "Could not find package consolibyte/quickbooks-php".
Any ideas what I'm doing wrong?
You're using incorrect package name - real package name is defined in composer.json of this package and it is consolibyte/quickbooks instead of consolibyte/quickbooks-php.
composer require "consolibyte/quickbooks:dev-master"
Also this package is registered at Packagist, so you don't need to add repository for it. See https://packagist.org/packages/consolibyte/quickbooks
Related
I'm trying to add the "cedarmaps-php-sdk" composer package to my Laravel project
the package can be found here: https://github.com/cedarstudios/cedarmaps-php-sdk
I have successfully installed the package using
composer install
&
composer update
The problem is when I want to use the 'CedarMaps' I get the error:
"main(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR')" *image
for now, I'have manually bypassed this problem by changing
require('vendor/autoload.php');
to
require('../vendor/autoload.php');
in the below file (the repository file)
vendor/cedarmaps/cedarmaps-php-sdk/src/CedarMaps.php
am I doing anything wrong?
+++++++++++++++++++++++++++++++++
Let me ask a question: Was that necessary for this package to require autoload.php itself
, I mean doesn't composer handle this autoloading for all packages automatically?
You need to use composer require 'package name' to install a package to your existing project then do a composer dump-autoload.
I executed these 2 commands:
composer require realrashid/sweet-alert
composer require infinety/alerts *#dev
They are packages to use SweetAlert on Laravel but they are not working and I found a better one, I want to remove them, when I do composer remove vendor/realrashid or composer remove vendor/infinety it say that the package is not installed and is not required in my composer.json, so It has not been removed but the package is still here..
No need to use vendor. Just composer remove realrashid/sweet-alert.
Another way is to go to your composer.json file and then remove that certain package then recall the 'composer update' method. Since composer remove will completely remove the library to your composer cache because you might using that library to other projects so when you try to composer install again that library, composer will download that package again instead of checking the composer cache memory.
you have to run this command in your terminal: composer remove vendor/package_name
I'm trying to install my first composer package which I have built for learning.
For that, I have successfully setup Github repository and packagist account:
https://github.com/xparthx/Composer-package-demo
https://packagist.org/packages/xparthxvorax/demo
The issue is when I'm trying to install it using composer require xparthxvorax/demo, it gives me following error:
[UnexpectedValueException]
Error while installing xparthxvorax/demo, composer-plugin packages should have a class defined in their extra key to be usable.
I think the issue is with the package type. As per this doc, the default package type should be library:
https://getcomposer.org/doc/04-schema.md#type
Create a new tag, because with composer require composer will try to install latest tag, which in your case is the one with "composer-plugin" type: https://github.com/xparthx/Composer-package-demo/blob/v1/composer.json
I am trying to install package library by composer in YII2. But after running the command from my command prompt I am getting following error
My composer command is
composer.phar require kartik-v/yii2-widget-datetimepicker "*"
Package yiisoft/yii2-codeception is abandoned, you should avoid using it. Use codeception/codeception instead.
When installing by this command
php composer.phar require kartik-v/yii2-social "#dev"
Then I am getting following error
Package facebook/php-sdk-v4 is abandoned, you should avoid using it. Use facebook/graph-sdk instead.
Generating autoload files
Please suggest me how can I resolve this error
This is not an error. This is just an information for you from composer that one of the required packages has been abandoned and you should not expect to get updates for it.
If you want to get rid of this information simply remove the mentioned packages from the composer.json file of your project.
If the package is not listed there it means that one of the required packages listed needs it as dependency so you can not remove it directly.
As for the Yii 2 - here is the current advanced project template's composer.json so you can update the one in your project - package yiisoft/yii2-codeception is no longer used.
I need to know how to install packages in laravel 4.
I have downloaded a bundle from github, but executing the bundle, I see it is deprecated in Laravel 4. Can anyone please help me.
Just using packagist, you can go to packagist.org , after that just put the package name at require key in your composer.json on your laravel project, and that run this command , composer update or compose install
in example :
// composer.json
"require": {
// default value..
"intervention/image": "dev-master",
}
i hope this help
Laravel 4 now uses composer to install packages.
You can add new packages to laravel via a few options on composer. One is on the command line.
> composer require author/package
> dev-master
After issuing the require command it will ask you what version to use. then run composer update, add the PackageServiceProvider to your app/config/app.php
First and always if you plan to use composer in your work, learn the basics of it (what is composer.json,composer.lock...)
There is excellent video on Laracasts https://laracasts.com/lessons/you-must-use-composer
That way you can avoid problems and enjoy using this great package manager.
Next use composer dump(-autoload) command frequently and composer self-update.
If that bundle is deprecated in Laravel4 than it is deprecated and you can't use it ( unless author made some changes and adopt it for l4 )
Also bundle is a l3 specific type and in l4 we have packages.
Ok, you can't execute composer commands on windows command prompt. mac/linux terminal would do but if you insist on using windows then install this [https://www.cygwin.com/] so you could issue unix commands