Cannot install packages via composer in yii2 - yii2

Every time when i try to install some package via composer in yii2. I have error like in picture.
How can i fix this? Help me please!

Upgrade fxp/composer-asset-plugin to latest version (1.2.1) and composer to latest version (1.2.0).
composer global require "fxp/composer-asset-plugin:^1.2.0"
composer selfupdate

Try this and then try to install packages
php composer.phar global update fxp/composer-asset-plugin --no-plugins

json file in your localhost and put your code in that
and then run command line and go to the composer.json directory
and then write composer init then cmd help you to continue the way

Thank you all for your advising! Compouser didn't accept any command the problem above had appear always. I think the problem appear after that i had change php.ini file. Problem solved by reinstaling Compouser and Xampp

Related

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

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"
}

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

Class 'yii\jui\DatePicker' not found (Not a duplicate one)!

I used composer to install it. I checked all needed files in vendor/yiisoft/yii2-jui existing. The extensions.php is all right. I have "use yii\jui\DatePicker;" in my file, But it still doesn't work.
How can I fix it? Thanks.
I believe you are missing Composer Asset Plugin. After you install Composer, run this command:
php composer.phar global require "fxp/composer-asset-plugin:~1.0.3"
after that, just to be safe run the self-update:
composer self-update
At this point you should probably get your GitHub credentials ready, because when you run composer update, the updater will start downloading loads of missing stuff (including Jui Asset), which will most likely hit the GitHub unauthorized request limit.
Hope this helps!

jekyll commands output some failure

I have something wrong with my jekyll installation. After typing however jekyll command in terminal, it outputs following:
/usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb:6:in
<module:Converters>': uninitialized constant Jekyll::Converters::Scss (NameError)
from /usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb:5:in ...'
Anyone knows what's wrong? I have no idea. Thanks
You can try to gem update or bundle update. This seems to be an old bug.
I had this problem with jekyll on Ubuntu 14.10. It's been fixed in Debian, and reported as a bug in Ubuntu. You can manually apply the same fix, it's just one line (see patch) that needs to be added to a file:
Open /usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb
Add require 'jekyll/converters/scss' at the top, just after require 'jekyll/utils'
Also make sure that the package ruby-mercenary is installed (sudo apt-get ruby-mercenary), because of another bug.
Then Jekyll will work. Alternatively, use Rubygems: gem install jekyll.

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).