fatal: No such remote 'composer' - composer-php

probably duplicate but still no answer Getting a “No such remote or remote group” error when trying to use a private repo in Composer
composer doesn't work again -_-
I have removed composer's cache using rm -rf ~/.composer/cache/ but the result didn't change !
the error with the exception trace :
$sudo composer update --prefer-dist -v
[sudo] password for mahdi:
Loading composer repositories with package information
Password for 'https://MahdiZ#bitbucket.org':
Reading composer.json of mysepandar/interfaces (start_repo)
Skipped tag start_repo, invalid tag name
Reading composer.json of mysepandar/interfaces (master)
Importing branch master (dev-master)
Password for 'https://MahdiZ#bitbucket.org':
Reading composer.json of mahdiz/tf-component-1 (master)
Importing branch master (dev-master)
Password for 'https://MahdiZ#bitbucket.org':
Reading composer.json of mahdiz/flat-config (master)
Importing branch master (dev-master)
Password for 'https://MahdiZ#bitbucket.org':
Reading composer.json of mahdiz/easy-two-factor (master)
Importing branch master (dev-master)
Updating dependencies (including require-dev)
Adding VCS repository bower-asset/yii2-pjax
Adding VCS repository bower-asset/punycode
Adding VCS repository bower-asset/jquery
Adding VCS repository bower-asset/typeahead.js
Reading bower.json of bower-asset/jquery (2.1.3)
Importing tag 2.1.3 (2.1.3.0)
Adding VCS repository bower-asset/jquery.inputmask
Reading bower.json of bower-asset/jquery.inputmask (3.1.61)
Importing tag 3.1.61 (3.1.61.0)
Reading bower.json of bower-asset/punycode (v1.3.2)
Importing tag v1.3.2 (1.3.2.0)
Adding VCS repository bower-asset/bootstrap
Reading bower.json of bower-asset/bootstrap (v3.3.2)
Importing tag v3.3.2 (3.3.2.0)
Reading bower.json of bower-asset/typeahead.js (v0.10.5)
Importing tag v0.10.5 (0.10.5.0)
- Updating mysepandar/interfaces dev-master (d9a7453 => 526a6d7)
Checking out 526a6d733f50ec5076cc3cba2c9d1c11cde2c484
[RuntimeException]
Failed to execute git remote set-url composer 'https://MahdiZ#bitbucket.org/mysepandar/interfaces.git' && git fetch composer && git fetch --tags composer
fatal: No such remote 'composer'
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/Util/Git.php:201
Composer\Util\Git->throwException() at phar:///usr/local/bin/composer/src/Composer/Util/Git.php:154
Composer\Util\Git->runCommand() at phar:///usr/local/bin/composer/src/Composer/Downloader/GitDownloader.php:88
Composer\Downloader\GitDownloader->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Downloader/VcsDownloader.php:116
Composer\Downloader\VcsDownloader->update() at phar:///usr/local/bin/composer/src/Composer/Downloader/DownloadManager.php:255
Composer\Downloader\DownloadManager->update() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:177
Composer\Installer\LibraryInstaller->updateCode() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:106
Composer\Installer\LibraryInstaller->update() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:172
Composer\Installer\InstallationManager->update() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:139
Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:578
Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:225
Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:140
Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:147
Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:84
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
require() at /usr/local/bin/composer:25
and my composer.json is :
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Application Template",
"keywords": [
"yii2",
"framework",
"basic",
"application 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",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://MahdiZ#bitbucket.org/mysepandar/interfaces.git"
},
{
"type": "vcs",
"url": "https://MahdiZ#bitbucket.org/MahdiZ/tfcomponenti.git"
},
{
"type": "vcs",
"url": "https://MahdiZ#bitbucket.org/MahdiZ/flatconfig.git"
},
{
"type": "vcs",
"url": "https://MahdiZ#bitbucket.org/MahdiZ/easytwofactor.git"
}
],
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"mahdi-zareie/yii2-general-base-classes": "dev-master",
"mysepandar/interfaces": "*",
"mahdiz/easy-two-factor": "*",
"mahdiz/tf-component-1": "*",
"mahdiz/flat-config": "*"
},
"require-dev": {
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*"
},
"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"
}
}
}

Removing the folder of the package that triggers the error from /vendor worked for me. In your case that would mean removing /vendor/mysepandar/.
Then run composer update again. If that fails update composer using composer self-update and rinse and repeat.

Related

satis composer package not found

I'm trying to create custom composer packages in order use/update some custom wordpress plugins across all my projects.
I decided on using satis, following this article: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md
I've installed satis, and successfully generated the webview and deployed it. It shows the two composer packages (git repositories) that were linked with satis.
Problem
When I create a new project and include my custom composer package in my package.json, running composer update returns an error.
Error
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package namespace/test could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
My package composer.json file:
{
"name": "name",
"type": "project",
"license": "MIT",
"description": "desc",
"authors": [],
"keywords": ["bedrock", "wp"],
"config": {
"preferred-install": "dist"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "composer",
"url": "https://packages.namespace.tld"
}
],
"require": {
"php": ">=5.6",
"composer/installers": "^1.4",
"vlucas/phpdotenv": "^2.0.1",
"johnpbloch/wordpress": "^5.0.2",
"oscarotero/env": "^1.1.0",
"roots/wp-password-bcrypt": "1.0.0",
"roots/wp-config": "1.0.0",
"wpackagist-plugin/contact-form-7": "*",
"namespace/test": "*"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0.2",
"roave/security-advisories": "dev-master"
},
"extra": {
"installer-paths": {
"www/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"www/app/plugins/{$name}/": ["type:wordpress-plugin"],
"www/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "www/wp"
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"test": [
"phpcs"
]
}
}

Laravel 5.6 composer doesn't install my package's dependencies

When i use "composer require x/y" command inside my custom package all done. Getting all dependencies perfectly.
But when i try to add to laravel project from bitbucket repository, only install my package without all dependencies.
I set my private repository to laravel composer.json file
"repositories": {
"hooks": {
"type":"package",
"package": {
"name": "x/y",
"version":"1.0.2",
"source": {
"url": "https://{username}#bitbucket.org/x/y.git",
"type": "git",
"reference": "master"
}
}
}
}
My custom repository composer.json
{
"name": "x/y",
"description": "Base Api System",
"license": "MIT",
"require": {
"php": "^7.2",
"tcg/voyager": "^1.1",
"predis/predis": "1.1",
"monarobase/country-list": "^2.0"
},
"require-dev": {
},
"autoload": {
"psr-4": {
"X\\Y\\": "src/"
}
},
"minimum-stability": "dev",
"extra": {
"laravel": {
"providers": [
"X\\Y\\XYServiceProvider"
]
}
}
}
Composer require output
Using version ^1.0 for x/y
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing x/y (1.0.2): Cloning master from cache
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
You're using package type incorrectly. This type is for non-composer packages. Composer will not even look at composer.json file in such dependency, since it assumes that this file does not exist. All relevant information about package should be in package definition in repositories setting in composer.json of main (root) application.
But in your case you have repository with complete composer package (with correct composer.json file), so you should vcs or git type:
"repositories": [
{
"type":"git",
"url": "https://{username}#bitbucket.org/x/y.git"
}
]

how to install magento2

Is there a way to install magento2 using composer? I found a command
composer create-project magento/community-edition ./ -s dev --prefer-dist
but is that somehow possible with just a composer.json and then
composer install
? I tried this:
{
"name": "asfasf",
"require": {
"magento/magento-composer-installer": "*",
"magento/product-community-edition": "0.1.0-alpha89"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.magento.com/"
}
],
"extra": {
"magento-root-dir": "htdocs",
"magento-deploystrategy": "copy"
},
"minimum-stability": "dev"
}
but that throws an error
[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://packages.magento.com/packages.json.
any hints on what I'm doing wrong?

requested package laravel/spark could not be found in any version

I am trying to install laravel Spark but getting a lot of errors no matter which method I try.
Upon adding "laravel/spark": "*#dev" in the composer.js file I am getting this error.
The requested package laravel/spark could not be found in any version,
there may be a typo in the package name.
Any clue what the issue is?
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.",
"laravel/cashier": "~6.0",
"laravel/spark": "#dev"
}
Added to the composer.js file and ran composer update. Got the couldn't found error.
In your composer.json file, add the following to the require section (note that, compared to what you currently listed, this one has an asterisk * before the # symbol):
"laravel/spark": "*#dev"
Then add this in its own section (or update accordingly):
"repositories": [
{
"type": "path",
"url": "./spark",
"options": {
"symlink": false
}
}
],
The options portion is optional and you can leave it out
You can then run your composer install command. You can confirm that things are good by running composer validate, which will trigger a warning and it's fine to ignore that. You should also check the composer.lock file to make sure you have something similar to this in there:
{
"name": "laravel/spark",
"version": "dev-develop",
"dist": {
"type": "path",
"url": "./spark",
"reference": "072b0bf217fbbe5018fc062612bb1fb5566d94e1",
"shasum": null
},
"require": {
"erusev/parsedown": "~1.0",
"firebase/php-jwt": "~3.0|~4.0",
"guzzlehttp/guzzle": "~6.0",
"intervention/image": "^2.3",
"php": ">=5.5.9",
"ramsey/uuid": "^3.1"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"mpociot/vat-calculator": "^1.6",
"phpunit/phpunit": "~5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"psr-4": {
"Laravel\\Spark\\": "src/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell#gmail.com"
}
],
"description": "Laravel Spark provides scaffolding for Laravel SaaS applications.",
"keywords": [
"billing",
"laravel",
"saas",
"scaffolding",
"stripe"
],
"transport-options": {
"symlink": false
}
},
Also, depending on your version and how you set things up, you'll have to check on the documentation because there's a few different ways to set this up:
https://spark.laravel.com/docs/6.0/installation#installation-via-composer
I'd also add that, you should never modify files in the ./spark directory. All changes are made in either ./resources/assets/js/spark or ./resources/views/vendor/spark (and, as always, you can override anything in the app directory unless you changed the namespace).
Oh, and these commands may be useful for you (obviously turn these into an actual alias or function that's aliased):
alias reset
rm -rf composer.lock node_modules package-lock.json vendor
composer install
npm install
gulp
composer validate
alias update
rm -rf node_modules vendor
composer install
npm install
composer update
npm update
reset
I would only run these as the branch master though, team members shouldn't have to do dependency updates for Composer and npm.

Don't work require in Copmposer

I have composer.json on project:
{
"repositories": [
{
"type": "vcs",
"url": "git#git.test.ua:bmp/composer.git"
}
],
"require": {
"pack/composer": "dev-master"
},
"minimum-stability": "dev"
}
git#git.test.ua:bmp/composer.git - it's my repo, that containe next composer.json file:
{
"name": "pack/composer",
"repositories": [
{
"type": "vcs",
"url": "git#git.test.ua:components/curl.git"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"pack/curl": "dev-master"
},
"autoload": {
"psr-4": {
"pack\\composer\\": ""
}
}
}
git#git.test.ua:components/curl.git - also my repo, that containe next composer.json file:
{
"name": "pack/curl",
"autoload": {
"psr-4": {
"pack\\curl\\": ""
}
},
"minimum-stability": "dev"
}
When I try to do composer install on my project, I receive next error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for pack/composer dev-master -> satisfiable by pack/composer[dev-master].
- pack/composer dev-master requires pack/curl dev-master -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
I already add param:
"minimum-stability": "dev"
If I remove require section from the seckond composer.json file the no error any more.
"pack/curl": "dev-master"
How fix it, I need this require?
Update:
{
"repositories": [
{"type": "vcs", "url": "https://git.test.ua/components/composer.git"},
{"type": "vcs", "url": "https://git.test.ua/components/curl.git"}
],
"require-dev": {
"pack/composer": "dev-master"
},
"minimum-stability": "dev"
}
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing pack/composer (dev-master 886d220)
Cloning 886d22082d4aa341731ebd87f280ee0f5a05fe37
Writing lock file
Generating autoload files
Update2 composer.lock file
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is #generated automatically"
],
"hash": "cc5c1fc7000544f6cfd9ba03a3ee4567",
"packages": [],
"packages-dev": [
{
"name": "pack/composer",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://git.test.ua/components/composer.git",
"reference": "886d22082d4aa341731ebd87f280ee0f5a05fe37"
},
"require-dev": {
"pack/curl": "dev-master"
},
"type": "library",
"autoload": {
"psr-4": {
"pack\\composer\\": ""
}
},
"time": "2015-04-24 07:13:31"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"pack/composer": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
Composer does not browse repositories recursively, i.e. ALL repositories that may contain software have to be mentioned in the root composer.json file.
You don't mention the repository of the pack/curl package there, so Composer cannot find this package.
I assume that "pack" is the vendor name you added partially in your question, because the error message still mentions "shkarbatov" as the vendor name.
Best way to avoid having to add hundreds of personal repositories everywhere is to have a packagist-like Composer repo that is mentioned everywhere and contains the metadata of all code repositories. Have a look at Satis.
Update:
Now after seeing your composer.lock file, the situation is clear: You are NOT using require to add your packages, but require-dev. This is for development dependencies (like adding PHPUnit or stuff needed to develop the package) of the root package only - any dev dependencies of packages added to the root package are NOT installed.
Change the dependencies of packages you need for production use to require all levels!

Resources