Webpack bundle repository not found - symfony

I have in my composer.json :
"symfony/webpack-encore-pack": "*",
In composer.lock :
{
"name": "symfony/webpack-encore-pack",
"version": "v1.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/webpack-encore-pack.git",
"reference": "8d7f51379d7ae17aea7cf501d910a11896895ac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/webpack-encore-pack/zipball/8d7f51379d7ae17aea7cf501d910a11896895ac4",
"reference": "8d7f51379d7ae17aea7cf501d910a11896895ac4",
"shasum": ""
},
"require": {
"symfony/asset": "^3.3|^4.0"
},
"type": "symfony-pack",
"extra": {
"thanks": {
"name": "symfony/webpack-encore",
"url": "https://github.com/symfony/webpack-encore"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A pack for Symfony Encore",
"abandoned": "symfony/webpack-encore-bundle",
"time": "2018-07-16T10:15:28+00:00"
},
When I try composer install I have the error : Installing symfony/webpack-encore-pack (v1.0.3): Downloading Failed to download symfony/webpack-encore-pack from dist: The "https://api.github.com/repos/symfony/webpack-encore-pack/zipball/8d7f51379d7ae17aea7cf501d910a11896895ac4" file could not be downloaded (HTTP/1.1 404 Not Found).
I checked this URL and the file didn't exist. How can I solve this issue?

symfony/webpack-encore-pack has seen its last update more than three years ago and is abandoned. The code is no longer present on Github, so it cannot be downloaded from the location that is stored in your composer.lock (that's what https://api.github.com/repos/symfony/webpack-encore-pack/zipball/8d7f51379d7ae17aea7cf501d910a11896895ac4 does: it links to the URL of a zipped version of that package in a specific version).
According to a discussion about this, you should use symfony/webpack-encore-bundle instead. Sadly, this package is not compatible with Symfony 3.3 in any version, so you might need to update it to v3.4

Related

How to install google analytics on drupal 9?

I have freshly installed drupal 9.
composer.json
{
"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",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
"require": {
"composer/installers": "^1.9",
"drupal/core": "self.version",
"drupal/core-project-message": "self.version",
"drupal/core-vendor-hardening": "self.version"
},
"require-dev": {
"behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.4",
"composer/composer": "^2.0.2",
"drupal/coder": "^8.3.10",
"fabpot/goutte": "^3.3",
"instaclick/php-webdriver": "^1.4.1",
"mikey179/vfsstream": "^1.6.8",
"phpunit/phpunit": "^8.5.14 || ^9",
"phpspec/prophecy": "^1.12",
"symfony/css-selector": "^4.4",
"symfony/phpunit-bridge": "^5.3.0",
"symfony/var-dumper": "^5.3.0",
"symfony/error-handler": "^4.4",
"justinrainbow/json-schema": "^5.2",
"symfony/filesystem": "^4.4",
"symfony/finder": "^4.4",
"symfony/lock": "^4.4",
"symfony/browser-kit": "^4.4",
"symfony/dom-crawler": "^4.4 !=4.4.5",
"easyrdf/easyrdf": "^0.9 || ^1.0"
},
"replace": {
"paragonie/random_compat": "9.99.99",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal9",
"platform": {
"php": "7.3.0"
}
},
"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"
],
"installer-paths": {
"core": ["type:drupal-core"],
"libraries/{$name}": ["type:drupal-library"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/Commands/contrib/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"drupal-core-project-message": {
"post-install-cmd-message": [
"<bg=blue;fg=white>drupal/drupal</>: This package is meant for core development,",
" and not intended to be used for production sites.",
" See: https://www.drupal.org/node/3082474"
],
"post-create-project-cmd-message": [
"<bg=red;fg=white>drupal/drupal</>: This package is meant for core development,",
" and not intended to be used for production sites.",
" See: https://www.drupal.org/node/3082474"
]
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
}
},
"autoload-dev": {
"psr-4": {
"Drupal\\Composer\\": "composer"
}
},
"scripts": {
"pre-install-cmd": "Drupal\\Composer\\Composer::ensureComposerVersion",
"pre-update-cmd": "Drupal\\Composer\\Composer::ensureComposerVersion",
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": [
"#composer update phpunit/phpunit --with-dependencies --no-progress",
"#composer require phpspec/prophecy-phpunit:^2 --no-progress --no-suggest"
],
"post-update-cmd": [
"Drupal\\Composer\\Composer::generateMetapackages"
],
"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": "path",
"url": "core"
},
{
"type": "path",
"url": "composer/Plugin/ProjectMessage"
},
{
"type": "path",
"url": "composer/Plugin/VendorHardening"
},
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}
I have read it is best to use composer for installign modules. So I am trying
php8.0 /usr/local/bin/composer require drupal/google_analytics
Using version ^3.1 for drupal/google_analytics
./composer.json has been updated
Running composer update drupal/google_analytics
> Drupal\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/google_analytics[dev-3.x, 3.1.0] require drupal/core ^8.8.6|^9.0 -> satisfiable by drupal/core[8.8.6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.3.x-dev] from composer repo (https://repo.packagist.org) but drupal/core[dev-main] from path repo (core) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
- drupal/google_analytics 3.x-dev is an alias of drupal/google_analytics dev-3.x and thus requires it to be installed too.
- Root composer.json requires drupal/google_analytics ^3.1 -> satisfiable by drupal/google_analytics[3.1.0, 3.x-dev (alias of dev-3.x)].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
How to understand those errors? Looks like it requires drupal 8 or 9 but i have 9 so why there is a problem? I see there is mentioned priorities, I have read https://getcomposer.org/doc/articles/repository-priorities.md but I do not get what I need to fix for it to work. Can you tell?
Deleted vendor directory. Ran composer install. Noticed message after installation
drupal/drupal: This package is meant for core development,
and not intended to be used for production sites.
See: https://www.drupal.org/node/3082474
Packages already clean.
In the link I saw composer command to create new project, so I modified it to this one and tried:
composer -n create-project drupal/recommended-project:* drupal3
then followed installation steps https://www.drupal.org/docs/installing-drupal
and then tried installing google analytics - and it went without problems.

How to solve this error in the name property of composer.json validation?

I got this error as i validate my composer.json file:
[Composer\Json\JsonValidationException]
"./composer.json" does not match the expected JSON schema:
- name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$
The name Property looks like this:
"name":"lukas735/united-in-faith",
I also tried out the following alternations:
"lukas735/united-in-faith",
"lukas/united-in-faith",
"lukas735/united.in.faith",
"lukas/united.in.faith",
"lukas735/united_in_faith",
"lukas/united_in_faith",
"lukas/uif",
"lukas735/uif",
None of this worked... The regex proofer said the forward slash is placed wrong... But its composer intern so i can't change anything on that. And anyway. My strings also not got matched if i corrected that in regex proofer.
Is there anyway to let match my united-in-faith String... The name before was just an account name because a video said this vendor-name can be choosed yourself... But video was from 2016. I found no hints in internet where to find the vendor-name. So i choosed it myself.
I saw some videos and topics about this naming convention, but they all not seemed to giving an answer which solved it.
What did I wrong?
Has anybody a solution for this error?
Here is my Composer.json File:
{
"name":"lukas735/united-in-faith",
"description":"description",
"keywords": [
"united-in-faith",
"united in faith",
"united_in_faith",
"dating"
],
"homepage": "https://...",
"license": "MIT",
"authors": [
{
"name": "...",
"email": "....",
"homepage": "...",
"role": "Developer"
}
],
"repositories":[
{
"type": "package",
"package": {
"name": "lukas735/united-in-faith",
"version": "1.0.0",
"source": {
"url": "https://github.com/...",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"components/jqueryui": "^1.12",
"united-in-faith": "dev-master"
},
"autoload": {
"psr-4": {
"lukas735\\": "sites/classes"
}
},
"recommend":{
"ext-zip":"*"
},
"bin":["bin"],
"config":{
"vendor-dir":"vendor"
},
"scripts": {
"test": "phpspec run",
"format": "phpcbf --standard=psr2 src/"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}
use command 'composer init' to make a new composer.json file, use old for reference

Composer install git repo into custom path (Wordpress theme)

I have a custom Wordpress theme hosted on Bitbucket that I'd like installed into the /themes directory in Wordpress when I run composer install.
I've played around with different repo 'types' e.g. vcs, package etc and I get errors for everything I've tried so far.
Here's a sample of my (not working) composer.json file:
{
"authors": [
{
"name": "Joe Bloggs",
"homepage": "http://www.example.com/"
}
],
"keywords": [
"wordpress", "composer", "wp"
],
"config": {
"secure-http": false
},
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "wordpress/wordpress",
"version": "4.5.3",
"type": "webroot",
"dist": {
"type": "zip",
"url": "https://wordpress.org/wordpress-4.5.3.zip"
},
"require" : {
"fancyguy/webroot-installer": "1.1.0"
}
}
},
{
"type": "vcs",
"url": "https://bitbucket.org/gurtfrobe/plunderscores.git"
}
],
"require": {
"php": ">=5.3.2",
"wordpress/wordpress": "4.5.3",
"fancyguy/webroot-installer": "1.1.0",
"composer/installers": "v1.0.12",
"gurtfrobe/plunderscores": "1.0.1"
},
"extra": {
"installer-paths": {
"wp/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
"wp/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"wp/wp-content/themes/{$name}/": ["type:wordpress-theme"]
},
"webroot-dir": "wp",
"webroot-package": "wordpress/wordpress"
}
}
I've also tried the following with no luck:
{
"type": "package",
"package": {
"name": "gurtfrobe/plunderscores.git",
"version": "1.0.1",
"type": "wordpress-theme",
"source": {
"url": "https://bitbucket.org/gurtfrobe/plunderscores.git",
"type": "vcs",
"reference": "master"
}
}
},
Is there a way of achieving this without submitting my theme to wpackagist?
I solved it with this article.
Remember to push the latest version tags after you've updated your composer.json file. Otherwise Composer will still try and download a previous version.

Composer Update - Could not load package shopware/shopware in http://packagist.org:

When i do composer update on my Laravel 5.1 it come out with this error
> Downloading http://packagist.org/p/symfony/polyfill-mbstring$a9a5f6e4a8af44008f50a8c0059a6d1a61b1f692627fb41f0cc1f3e8bbfb7205.json
> Writing /root/.composer/cache/repo/https---packagist.org/provider-symfony$polyfill-mbstring.json into cache
[RuntimeException]
Could not load package shopware/shopware in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ~v
2.0.0-rc1: Invalid version string "~v2.0.0-rc1"
[UnexpectedValueException]
Could not parse version constraint ~v2.0.0-rc1: Invalid version string "~v2.0.0-rc1"
when i trace it on cache folder
"require-dev": {
"phpunit\/phpunit": "~4.5",
"phpunit\/dbunit": "~1.3",
"behat\/mink": "~1.7",
"behat\/mink-extension": "~2.1",
"behat\/mink-goutte-driver": "~1.2",
"behat\/mink-selenium2-driver": "~1.3",
"symfony\/dom-crawler": "~2.8",
"behat\/behat": "~3.1",
"sensiolabs\/behat-page-object-extension": "~v2.0.0-rc1"
},
it is on not on my require package : composer.json
it is from symfony/polyfill-mbstring
but why on json file they got this?
"packages": {
"shopware\/shopware": {
"5.2.x-dev": {
"name": "shopware\/shopware",
"description": "Shopware is the next generation of open source e-commerce software made in Germany",
"keywords": ["shop", "shopware"],
"homepage": "http:\/\/www.shopware.com",
"version": "5.2.x-dev",
"version_normalized": "5.2.9999999.9999999-dev",
"license": ["AGPL-3.0", "proprietary"],
"authors": [],
"source": {
"type": "git",
"url": "https:\/\/github.com\/shopware\/shopware.git",
"reference": "4c4817979a98144e57d9eebc5aa166795e378a1c"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/shopware\/shopware\/zipball\/4c4817979a98144e57d9eebc5aa166795e378a1c",
"reference": "4c4817979a98144e57d9eebc5aa166795e378a1c",
"shasum": ""
},
"type": "project",
"time": "2016-03-29T06:54:10+00:00",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Proxy\\AbstractProxyFactory": "engine\/Library\/",
"Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister": "engine\/Library\/",
"Shopware": "engine\/",
"Enlight": "engine\/Library\/",
"Zend": "engine\/Library\/",
"JSMin": "engine\/Library\/minify\/"
},
"classmap": ["engine\/Shopware\/Core\/"],
"files": ["engine\/Shopware\/Application.php"]
},
"include-path": ["engine\/Library\/"],
"require": {
"php": ">=5.5.9",
"ext-curl": "*",
"ext-mbstring": "*",
"ext-gd": "*",
"doctrine\/common": "2.5.1",
"doctrine\/dbal": "2.5.1",
"doctrine\/orm": "2.5.1",
"beberlei\/assert": "2.4.0",
"zendframework\/zend-escaper": "2.5.1",
"oyejorge\/less.php": "1.7.0.5",
"guzzlehttp\/guzzle": "5.1.0",
"egulias\/email-validator": "1.2.9",
"symfony\/http-kernel": "2.8.0",
"symfony\/config": "2.8.0",
"symfony\/dependency-injection": "2.8.0",
"symfony\/validator": "2.8.0",
"symfony\/filesystem": "2.8.0",
"symfony\/finder": "2.8.0",
"symfony\/console": "2.8.0",
"symfony\/polyfill-php56": "1.0.0",
"monolog\/monolog": "1.17.2",
"doctrine\/cache": "1.6.0",
"paragonie\/random_compat": "1.1.5",
"symfony\/form": "2.8.0",
"league\/flysystem": "1.0.18",
"elasticsearch\/elasticsearch": "2.1.5",
"ongr\/elasticsearch-dsl": "v2.0.0"
},
"require-dev": {
"phpunit\/phpunit": "~4.5",
"phpunit\/dbunit": "~1.3",
"behat\/mink": "~1.7",
"behat\/mink-extension": "~2.1",
"behat\/mink-goutte-driver": "~1.2",
"behat\/mink-selenium2-driver": "~1.3",
"symfony\/dom-crawler": "~2.8",
"behat\/behat": "~3.1",
"sensiolabs\/behat-page-object-extension": "~v2.0.0-rc1"
},
"replace": {
"symfony\/polyfill-php55": "~1.0",
"symfony\/polyfill-mbstring": "~1.0"
},
"uid": 588566
}, bla ...............
I've had exact same error
./composer.phar selfupdate solve the problem, for me.
Seems to be a problem with composer itself, we had the same problem with our global composer.
You will need to clear the cache and vendor maps in /root/.composer/ and update composer itself:
cd /root
curl -sS https://getcomposer.org/installer | sudo php --
php composer.phar global update
rm composer.phar
This is not an issue in Composer but with the Shopware upstream packages.
The following commit broke this dependency on March 29th:
https://github.com/shopware/shopware/commit/e44e4a7d788675489aadbd664c50a7cfc47e0f05
The following commit fixed it a day later:
https://github.com/shopware/shopware/commit/0cec1d69e972150b3d1fa71b82e621031ff341e3
So if you are still experiencing this issue use the following commands to fix:
composer clear-cache
composer update shopware/shopware

Symfony2 using third party vendors inside a bundle

I am creating a CpanelBundle which will integrate the Cpanel xmlapi into Symfony.
I will use the class provided by CpanelInc here: https://github.com/CpanelInc/xmlapi-php.
I want to make this bundle usable across projects and also open source.
The Symfony documentation says you should not put third party libraries into your bundles. The Cpanel class also don't have a namespace and its not on composer.
I could and should put the Cpanel class in vendor folder but how can I add it to autoload and to my bundle composer.json so when I release my bundle the user will also get it?
Hello you can load this file using composer. Please see composer autoload documentation
Your composer.json can looks like:
{
"name": "my/bundle",
"autoload": {
"psr-0": {"": "src"}
},
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": ">=2.1,<2.3-dev",
"CpanelInc/xmlapi-php": "*"
},
"repositories": [
{
"type": "package",
"package": {
"name": "CpanelInc/xmlapi-php",
"version": "master-dev",
"dist": {
"url": "http://github.com/CpanelInc/xmlapi-php/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/CpanelInc/xmlapi-php.git",
"type": "git",
"reference": "master"
},
"autoload": {
"files" : ['xmlapi.php']
}
}
}
]
}
Will be even better when you just create composer.json and add it for CpanelInc/xmlapi-php and do PR :)

Resources