Yii2 kartik-v ExportMenu - kartik-v

I have installed this particular plugin for Yii2 and unfortunately, I receive the following error
My composer version is 1.8.4, composer.json (require section)
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0",
"kartik-v/yii2-widget-datepicker": "#dev",
"kartik-v/yii2-widget-fileinput": "#dev",
"kartik-v/yii2-detail-view": "#dev",
"kartik-v/yii2-widgets": "*",
"kartik-v/yii2-grid": "#dev",
"slavkovrn/yii2-lightbox": "*",
"kartik-v/yii2-krajee-base": "*",
"kartik-v/yii2-export": "#dev"
and of course php version
Any idea what could be wrong?
Regards

I just found the solution to my problem by updating composer php path to version 7.1 instead of 5.5.12 that was set by default.
Regards

Related

composer update Errors, [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

I'm getting an error while trying to install any plugin.
I have tried to remove:
composer global remove "fxp/composer-asset-plugin"
And then update it again:
composer global require "fxp/composer-asset-plugin:*"
But I am still getting the following errors:
Deprecation Notice: The
Composer\Package\LinkConstraint\MultiConstraint class is deprecated,
use Composer\Semver\Constraint\MultiConstraint instead. in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/MultiConstraint.php:17
Deprecation Notice: The
Composer\Package\LinkConstraint\LinkConstraintInterface interface is
deprecated, use Composer\Semver\Constraint\ConstraintInterface
instead. in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17
[ReflectionException] Class
Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
[ErrorException] Declaration of
Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::whatProvides(Composer\DependencyResolv
er\Pool $pool, $name) should be compatible with
Composer\Repository\ComposerRepository::whatProvides(Composer\Depen
dencyResolver\Pool $pool, $name, $bypassFilters = false)
Can anyone help me figure out what am I doing wrong and how to solve it?
Here is my composer.json
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0.6",
"yiisoft/yii2-bootstrap": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0",
"2amigos/yii2-date-picker-widget": "~1.0", "kartik-v/yii2-widget-select2": "#dev", "kartik-v/yii2-grid": "#dev", "cebe/js-search": "~0.9", "kartik-v/yii2-editable": "#dev",
"phpoffice/phpexcel": "dev-develop"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/base": "^2.2.3",
"codeception/verify": "~0.3.1"
},
"config": {
"process-timeout": 1800,
"fxp-asset":{
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
} }

Cannot install Kartik Dialog

This is my composer .json file
{
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"kartik-v/yii2-nav-x": "*",
"johnitvn/yii2-ajaxcrud": "*",
"kartik-v/yii2-grid": "#dev",
"kartik-v/yii2-widget-timepicker": "*",
"kartik-v/yii2-widget-colorinput": "*",
"kartik-v/yii2-widget-datepicker": "#dev",
"kartik-v/yii2-widget-select2": "#dev",
"kartik-v/yii2-date-range": "dev-master",
"kartik-v/yii2-field-range": "dev-master",
"kartik-v/yii2-helpers": "dev-master",
"kartik-v/yii2-widget-datetimepicker": "*",
"kartik-v/yii2-widget-typeahead": "*",
"kartik-v/yii2-tabs-x": "#dev",
"bedezign/yii2-audit": "*",
"2amigos/yii2-chartjs-widget": "*",
"wbraganca/yii2-dynamicform": "*",
"kartik-v/yii2-mpdf": "*",
"kartik-v/yii2-export": "#dev",
"kartik-v/yii2-dialog": "#dev"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/base": "^2.2.3",
"codeception/verify": "~0.3.1"
},
"config": {
"process-timeout": 1800,
"fxp-asset":{
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
}
I get the source code from GitHub and add "kartik-v/yii2-dialog": "#dev" into the file and run composer update
But then it keep showing error
Problem 1
- kartik-v/yii2-dialog v1.0.1 required bower-asset/bootstrap3-dialog ~1.34 ->no matching package found.
- kartik-v/yii2-dialog v1.0.0 required bower-asset/bootstrap3-dialog ~1.34 ->no matching package found.
- Installation request for kartik-v/yii2-dialog * -> satisfiable by kartik-v/yii2-dialog[v1.0.0, v1.0.1].
Can anyone tell what is the problem? I try with another pc and instaill and it works. It just cant work on my own pc
I searched a bit about this problem and I have found out there are several solutions.
You can try to go to option #2 first if you don't want to test this option. Try to install Yii2 from scratch and attempt to install this widget first. If it works, then it means there are problems with your previous project's package dependencies.
If first option didn't work, then the problem is probably with composer.
Try the following commands:
composer self-update
composer update
If not solved, then try further:
composer global require "fxp/composer-asset-plugin: ^1.3.1"
composer update
If you're OK with transferring files, you can do whatever you wanted to do in a computer that has a working composer. Then, when it's done, copy entire project to that computer where the composer isn't working. This is probably the satisfiable option, though.

Error in creating yii2 project with composer

I want to create yii2 project in windows 10. I use composer create-projectcommand truly, but I against with error.
Here is composer create-project command in Command Prompt:
And of course I get the same error in composer global require "fxp/composer-asset-plugin:~1.2.0":
I had no composer.json file in folder C:/Users/Mohammad/AppData/Roaming/Composer after installing composer-setup.exe, and I copied composer.json file from one of my projects in folder C:/Users/Mohammad/AppData/Roaming/Composer.
This is my composer.json in folder C:/Users/Mohammad/AppData/Roaming/Composer:
{
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Project Template",
"keywords": ["yii2", "framework", "advanced", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"franciscomaya/yii2-sceditor": "dev-master",
"kartik-v/yii2-widget-sidenav": "*",
"mohammad-mahdy/yii2-jdate": "*",
"2amigos/yii2-ckeditor-widget" : "*",
"2amigos/yii2-gallery-widget": "~1.0",
"romka-chev/yii2-swiper" : "*",
"kartik-v/yii2-widgets": "*",
"kartik-v/yii2-grid": "#dev",
"yiisoft/yii2-imagine": "*",
"omnilight/yii2-shopping-cart": "*",
"fxp/composer-asset-plugin": "^1.0"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
Please help me to fix it.
I have no problems in installing yii2 project using composer in my windows 10 system. Delete the folder basic or yii2Basic inside C:\xampp\htdocs and follow these steps for smooth installation.
Check composer is installed on your system. You can check this by typing composer in your command line and hitting enter. If composer is successfully installed you will see a screen like this.
Next step is to install the Composer Asset Plugin.Before that you need to remove the folder composer from C:/Users/Mohammad/AppData/Roaming/Composer if one is there.Then Run the following command to install it.
composer global require "fxp/composer-asset-plugin:~1.2.0"
Now navigate to the directory you wish to maintain your source code.In your case it would be
cd C:\xampp\htdocs
Now to install the basic application template run the command below.
composer create-project yiisoft/yii2-app-basic basic 2.0.10
In the process you might see a screen as given below asking you to input token.
This is normal just login to your github account and paste the url given to generate the token.The copied token is then pasted for the installation to continue.Sometimes you might be asked to enter your github username and password,these are normal just follow the steps and you are ready to go.
If still the problem persists check the contents inside of your composer.json
Contents inside my composer.json is given below
{
"require": {
"fxp/composer-asset-plugin": "^1.2.0"
}
}
Go to the folder:
C:/Users/Mohammad/AppData/Roaming/Composer
and edit the composer.json file.
Make sure there are no unnecessary entries (like non-global packages).
For example my global composer.json looks like this:
{
"require": {
"fxp/composer-asset-plugin": "1.2.0",
"codeception/codeception": "^2.2"
}
}
After removing what should not be there save it and run in console
composer global update
There is a chance you have installed some package like Yii 2 globally and that is why you get this error.
If this goes fine you can go to the project folder and retry to install Yii 2 (don't use global when installing local project like this).
If you don't want to use plugin to create Yii2 project, you could try fixed Bower one:
Basic Template:
composer create-project --prefer-dist yidas/yii2-app-basic
Advanced Template
composer create-project --prefer-dist yidas/yii2-app-advanced
With fixed Bower vendor, which could prevent your Composer error.
Refer yidas/yii2-composer-bower-skip

Yii2 with composer and fxp/composer-asset-plugin

I'm working on a project using Yii2 PHP framework. Yii2 uses composer with fxp/composer-asset-plugin to handle project dependencies.
The problem is when a new developer comes to the project and runs
git clone <project-repo>
composer install
or another developer wants to install a new extension with composer require <package-name> often (very often) something goes wrong and composer (or maybe asset plugin, I mentioned above) shows another unclear error message (maybe only for me). And the developer spends lots of time to find what that error meant and how to deal with it.
Today I've cloned project on Windows machine, installed the latest composer and asset plugin versions, run composer install and, after about 20 minutes waiting, got this:
On my Linux system same dependencies have been installed without errors.
Question №1
What does this error mean and how can I fix it?
Question №2
Is it so bad idea to add vendor/ directory to version control? (I've read https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md)
Question №3
Maybe I'm doing something wrong or there is a secret, I'm not aware about, that allows to manage dependencies in Yii2 without such huge time loss.
Many thanks.
composer.json:
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/ZeroVision/swiftmailer.git"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"giggsey/libphonenumber-for-php": "~7.0",
"yiisoft/yii2": "2.0.7",
"swiftmailer/swiftmailer": "dev-fixStreamBufferTransport",
"yiisoft/yii2-bootstrap": ">=2.0.3",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-authclient": "^2.0#dev",
"2amigos/yii2-date-picker-widget": "~1.0",
"kartik-v/yii2-widget-timepicker": "*",
"kartik-v/yii2-widget-rating": "*",
"2amigos/yii2-gallery-widget": "~1.0",
"2amigos/yii2-ckeditor-widget": "~1.0",
"uran1980/yii2-scroll-to-top": "dev-master",
"yii-cms/yii2-robokassa": "^1.1",
"onokumus/metismenu": "v2.4.2",
"rmrevin/yii2-fontawesome": "*",
"dektrium/yii2-user": "*",
"p2made/yii2-sb-admin-theme": "1.1.2",
"p2made/yii2-p2y2-things": "*",
"p2made/yii2-asset-collection": "*",
"demi/image": "~1.0",
"demi/cropper": "~1.0",
"cyneek/yii2-widget-upload-crop": "dev-master",
"Nemmo/yii2-attachments": "*",
"2amigos/yii2-file-input-widget": "*",
"rkit/yii2-ajaxform-plugin": "^0.0.4",
"nsept/yii2-birthday-picker": "*",
"bryglen/yii2-apns-gcm": "1.0.4"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"runtime": "0777",
"web/assets": "0777",
"yii": "0755"
}
],
"generateCookieValidationKey": [
"config/web.php"
]
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
Try installing the dev-master of the asset-plugin
composer global require "fxp/composer-asset-plugin:dev-master"
It solved a lot of problems on our end.

yii2 composer update on windows machine with cmd getting error

i having the problem with updating extinctions through composer on local windows 7 machine.
i just want to add
"kartik-v/yii2-widget-datepicker": "#dev"
in composer.json file.
after adding this line of code and giving command to update on cmd as..
composer update
its showing me following error message on cmd line.. please see this one..
i just change code in composer "minimum-stability": "stable",
to `"minimum-stability": "dev",
as i got solution from stackoverflow so i tried but not work for me.
my whole composer code is here..
{
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Project Template",
"keywords": ["yii2", "framework", "advanced", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*",
"kartik-v/yii2-widget-datepicker": "#dev"
},
"config": {
"process-timeout": 1800
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
please help... it will be a great appreciation for me.
Thanking you in advanced.
Try this in cmd
php composer.phar update
Run this command
php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
Then run your command
You should run the following command first:
composer global require "fxp/composer-asset-plugin:1.0.0"
Try with this
composer selfupdate
This is correct way to install last version.
composer global require "fxp/composer-asset-plugin:~1.1"