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?
Related
I am new in laravel 7. i want ask how to install github package into my laravel project.
(https://github.com/lomotech/jajahan) this package i want to install to my laravel but not instruction in this package.
If a package is missing a composer.json, you can add the following to your project's composer.json:
"repositories": [
{
"type": "package",
"package": {
"name": "lomotech/jajahan",
"version": "v2.2018.01",
"source": {
"url": "https://github.com/lomotech/jajahan",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"lomotech/jajahan": "*"
},
"autoload": {
"psr-4": {
"Lomotech\\Jajahan\\": "vendor/lomotech/jajahan/"
}
},
The autoload entry allows composer to generate the vendor classmaps so you can use the package in your code by:
use Lomotech\Jajahan\SomeClassFile;
Finally, run composer install/update.
I am trying to set up Composer to work without internet access. I have set up a server in the local network with a Satis configured repository with the following configuration file:
{
"name": "private/composer",
"homepage": "http://<some_ip>:9500",
"repositories": [
{"type": "composer", "url": "https://packagist.org"}
],
"require-dependencies": true,
"require": { ... },
"archive": {
"directory": "offline",
"format": "zip"
},
"config": {
"preferred-install": "dist"
}
}
After running
$ ./satis/bin/satis build ./satis.json ./mirror
Everything works, I get my ./satis/mirror/offline directory filled up with .zip files of the packages I am mirroring from packagist.org.
In my Composer, project, I added the following sections to the composer.json configuration:
{
"repositories": [{
"type": "composer",
"url": "http://<some_ip>:9500"
}],
"config": {
"secure-http": false
},
...
}
I tried to run composer install then and I get an error about Composer not begin able to access https://packagist.org/packages.json. Why is it trying to do that? How can I make this process work without internet access?
Thank you!
By default Composer does not disable access to packagist.org when you add custom repos. You can disable it with the following config:
{
"repositories": [
{
"packagist.org": false
}
]
}
I am having troubles updating Drupal from composer.
Running composer update gives med this error, that I need help to interpret:
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
- don't install drupal/core 8.6.3|remove drupal/drupal dev-master
- don't install drupal/core 8.6.x-dev|remove drupal/drupal dev-master
- don't install drupal/core 8.7.x-dev|remove drupal/drupal dev-master
- Installation request for drupal/drupal dev-master -> satisfiable by drupal/drupal[dev-master].
- Installation request for drupal/core ^8.6.3 -> satisfiable by drupal/core[8.6.3, 8.6.x-dev, 8.7.x-dev].
My composer.json file looks like this:
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"composer/installers": "^1.2",
"wikimedia/composer-merge-plugin": "^1.4",
"algolia/algoliasearch-client-php": "^1.14",
"drupal/raven": "^2.4",
"drupal/core": "^8.6.3"
},
"require-dev": {
"webflo/drupal-core-require-dev": "^8.6.0"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": true,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"core": ["type:drupal-core"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
}
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "#composer update phpunit/phpunit --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}
This is compatibility issue with PHP & composer version.I have changed version PHP 7.1 with composer 1.7.2 to execute it.
If your installed composer version above 1.7.2 then use below command to downgrade :
composer self-update 1.7.2
I developed a Laravel 5.5 package with package auto discovery and pushed it at git hub
https://github.com/adamibrahim/authconfirm
when i run
$ composer require "adamibrahim/authconfirm" : "v0.1.1"
I got an error
could not find package adamibrahim/authconfirm at any version for your min ...
do i need to register my repository somewhere so i can use composer require command ?
here is my package composer.json
{
"name": "adamibrahim/authconfirm",
"type": "library",
"description": ":Laravel 5.5 Auth modifications to confirm the auth email",
"keywords": [
"Laravel5.5",
"Auth",
],
"homepage": "https://github.com/adamibrahim/authconfirm",
"license": "MIT",
"authors": [
{
"name": ":Adam Ibrahim",
"email": ":adamibrahim1701#gmail.com",
"homepage": ":author_website",
"role": "Developer"
}
],
"require": {
"illuminate/support": "~5.1",
"php" : "~5.6|~7.0"
},
"require-dev": {
"phpunit/phpunit" : ">=5.4.3",
"squizlabs/php_codesniffer": "^2.3"
},
"autoload": {
"psr-4": {
"Adamibrahim\\Authconfirm\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Adamibrahim\\Authconfirm\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"config": {
"sort-packages": true
}
}
Well, it's not enough just to create Github repository to use it via composer. You should create account at https://packagist.org/ and add your package in there to make it available via composer require.
In addition you should setup Packagist integration on Github at:
https://github.com/adamibrahim/authconfirm/settings/installations
to make sure after changes in Github Packagist will see those changes.
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.