I am trying to install paypal package and facing this error
This is how my composer.json looks
"require": {
"php": ">=5.6.4",
"doctrine/dbal": "^2.5",
"gloudemans/shoppingcart": "^2.5",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"zizaco/entrust": "5.2.x-dev"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
Related
Today i did a composer update on my project. During updating dektrium return error :
here is my composer:
{
"name": "my company",
"description": "my company website",
"keywords": ["computers", "advanced", "web design"],
"homepage": "here is a link",
"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": "*",
"kartik-v/yii2-widget-fileinput": "#dev",
"omgdef/yii2-multilingual-behavior": "~2.0",
"yiisoft/yii2-imagine": "~2.0.0",
"dektrium/yii2-user": "0.9.*#dev",
"kartik-v/yii2-widget-select2": "#dev",
"dektrium/yii2-rbac": "dev-master",
"geoip2/geoip2" : "~2.0",
"maxmind-db/reader" : "~1.0",
"skeeks/yii2-mobile-detect": "*",
"kartik-v/yii2-widget-alert": "*",
"jlorente/yii2-widget-remainingcharacters": "*",
"himiklab/yii2-recaptcha-widget": "*",
"kartik-v/yii2-export": "^1.2"
},
"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"
}
}
}
The error is :
"Update failed ( Failed to execute git show-ref --head -d fatal:
unexpected line in .git/packed-refs:
^4c5c383f577256d34cbc37ed26809a8ff109b2ec? )
Would you like to try reinstalling the package instead [yes]?
[RuntimeException] Failed to execute git show-ref --head -d
fatal: unexpected line in .git/packed-refs:
^4c5c383f577256d34cbc37ed26809a 8ff109b2ec? "
and after that the updating is stop ... i dont know what to do ...
How can I fix this error? Thanks.
Try these steps:
Delete vendor directory from your project.
Run composer clear-cache command.
Run composer install again.
Change your version for dektrium/yii2-user to the following in composer.json
"dektrium/yii2-user" : "^0.9.12",
and run composer update
try matching your composer.json to the following
"minimum-stability" : "dev",
"prefer-stable" : true,
"require" : {
"php" : ">=5.4.0",
"yiisoft/yii2" : "*",
"yiisoft/yii2-bootstrap" : "~2.0.0",
"yiisoft/yii2-swiftmailer" : "~2.0.0",
"dektrium/yii2-user" : "^0.9.12",
"dektrium/yii2-rbac" : "1.0.0-alpha#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"
}
}
},
"scripts" : {
"post-install-cmd" : "php init --env=Development --overwrite=n"
}
Notice : that i have used config.fxp-asset.installer-paths rather than extra.asset-installer-paths that has been deprecated.
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"
}
}
} }
given is following JSON-File:
{
"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": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0"
},
"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
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
}
How to read out property minimum-stability?
Following code fails by throwing out error:qnips_JSON_Loesung.html:112 Uncaught ReferenceError: stability is not defined
output+="<th class='spalte'>"+daten.minimum-stabilty+"</th></tr>";
By the way, following construct works quite fine:
output+="<th class='spalte'>"+daten.keywords+"</th></tr>";
The - makes JavaScript think it's a calculation.
Either remove that when the file is created or access it like a map.
Here daten.minimum-stabilty is being confused with this expression (i.e. daten.minimum - stabilty). It thinks to subtract between daten.minimum and stability
To access a key that contains dash or other characters that are not permissible to be appear as an identifier, use brackets notation like this
daten["minimum-stabilty"];
Have you tried like this to access the json key that contains - ?
var json_with_dash_key = daten["minimum-stabilty"];
output+="<th class='spalte'>"+ json_with_dash_key +"</th></tr>";
Using daten["minimum-stabilty"] should work fine
Other alternatives are also suggested in the older post related to this problem: Unable to access JSON property with "-" dash
Following code solved my problem:
for(let j in daten["require-dev"]){
output+="<label> Version "+daten["require-dev"][j]+"<br></label>";
}
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.
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"