My composer.json does not install new dependencies using composer update command - json

I am installing external dependencies using composer update command. The following is the section of the composer.json file in c:\xampp\htdocs\myproject\vendor\laravel\framework\ directory.
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
"illuminate/html": "5.0.*#dev"
},
I am getting the following results after running the composer update command:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
I have also tried to create another require array in the composer.json and added the packages I want to install with no success.
The composer update command could not install any unstalled dependency using the composer update command. Even composer self-update did not solve the problem.
Kindly assist me, I have been stuck here for some days now trying all I would do but without success.
I am changing the composer.json under the following directory: c:\xampp\htdocs\myproject\vendor\laravel\framework\ Is this ok?

Don't change any files inside the vendor directory, they are managed by Composer. To install further packages use the composer.json in your project's directory.
And use composer install to install new packages as composer update will update already installed packages to newer versions (if available) too.
composer self-update just updates Composer itself.

You missed column after "matriphe/imageupload": "5.1.*", try to change it:
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*",
"illuminate/html": "5.0.*#dev"
}

Related

Apply Drupal Patch using composer.json file

How to apply a patch for Drupal modules files through a composer.json file?
Basically, I have installed slick module and customised code and created a patch file using "git diff" command. Slick module file path is modules/contrib/slick/ directory. Below is the code that i have written in the composser.json file.
"require": {
"drupal/slick": "^2.7",
}
----------------------------------
"patches": {
"drupal/slick": {
"Slick custom changes": "patches/slick/slick.patch"
},
But when running composer install, it just removes this slick package from "modules/contrib/slick, but does not reinstall or add the patch.
If i remove "Slick custom changes": "patches/slick/slick.patch" from composer.json and execute composer install cmd then it install slick module.
How to avoid removing this package and applying the patch?

Composer could not find the config file: C:\composer To initialize a project, please create a composer.json file

I'm trying to install Laravel on my Windows 10, I have set composer in PATH.
The steps that I have executed were:
create a folder called laravel in htdocs folder of xampp C:\xampp\htdocs\Laravel, then I used
cd C:\xampp\htdocs\Laravel
to access this folder then I ran the command
composer create-project laravel/laravel Laravel
While installing, I got this error
[InvalidArgumentException] Composer could not find the config
file: C:\composer
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Try deleting the environment variable. Try Control Panel-->System-->Edit the system environment variables-->Environment variables-->composer-->delete
Then try to create the laravel project normally.

How to remove extension from vendor?

I have cloned a project written in Yii2. There are some extensions in vendor folder which I want to remove them from project. How can I do this? I am sure they are installed using composer because they are noted in composer.lock file.
If you just want to remove packages from the vendor folder you can use composer command:
composer remove package/name
If you want to remove calls to these packages in the project you need to do this manually.
You can delete the line with the name of the package from the composer.json and make in command line composer update

Yii2 DatePicker installation

Found documentation about this widget here and library here.
Tried to install with Composer and failed:
Tried to copy "yiisoft/yii2-jui": "~2.0.0" to composer.json and then update Composer and failed again:
Class 'yii\jui\DatePicker' not found
Is there any way to install this extension without using Composer?
Did you install composer global require "fxp/composer-asset-plugin:1.0.0" ? It is a NPM/Bower Dependency Manager for Composer that required by yii2. Before installing yii2-jui try this command, and then composer update

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).