Requirements could not be resolved personal repository - composer-php

Anybody can help me solve this issue? I'm trying to add a dependency on a personal repository. I didn't have any issues with my other repositories, but I have issues with this one.
Here is the composer.json file of the personal repository :
{
"name": "bundle-name-1",
"type": "symfony-bundle",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "*",
"symfony/monolog-bundle": "^3.3",
"symfony/yaml": "*"
},
"require-dev": {
"symfony/dotenv": "*",
"symfony/test-pack": "^1.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
...
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
...
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
Here is the composer.json file of the main project :
{
"name": "bundle-name-2",
"type": "symfony-bundle",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "*",
"symfony/monolog-bundle": "^3.3",
"symfony/yaml": "*",
"bundle-name-1": "~0.9.2"
},
"require-dev": {
"symfony/dotenv": "*",
"symfony/test-pack": "^1.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"repositories": [
{"type": "vcs", "url": "ssh://git#stash.domainname.com:8999/core/bundlename1repository.git"}
],
...
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
...
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
I've removed autoload and scripts for both.
The composer message is :
don't install bundle-name-1 v0.9.3|remove bundle-name-2 dev-master
Installation request for bundle-name-1 ~0.9.2 -> satisfiable by bundle-name-1[v0.9.2, v0.9.3].

The issue comes from the "replace" clause. It was added automatically when creating the symfony skeleton and my bundle wasn't replacing any of these.
Solution :
Remove the "replace" clause from the "composer.json".
Run "composer update"

Related

Generate barcode image works local but not on the server (Symfony 4)

I want to generate barcodes in my application.
When I run the code locally
php bin/console server:run 0.0.0.0
on my Windows PC, it works like a charm, but when I push it to my Git repository and pull it on my Apache2 Server an test it there, I get black bars.
The composer.json files are the same and the PHP Version also (PHP 7.4.7)
I am working with Symfony 4 and picqer/php-barcode-generator (https://github.com/picqer/php-barcode-generator).
In the controller:
$barcodeList[$barcode->getId()]['img'] = base64_encode($generator->getBarcode(intval($barcode->getValue()), $generator::TYPE_EAN_13, 1, 25));
In the template:
<img src="data:image/png;base64,{{ barcode.img }}" >
Example of the result on my local PC:
data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2OTApLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAGQBfAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8ATUf+TevEf/cK/wDSTT66DxD/AMgPwn/2UCT/ANLbquf1H/k3rxH/ANwr/wBJNProPEP/ACA/Cf8A2UCT/wBLbqgDgPGX/JFbb/sK6b/6aIa3/Fv/ACM/w6/7GvU//TktYHjL/kitt/2FdN/9NENb/i3/AJGf4df9jXqf/pyWgDoPBv8AyHLn/soGpf8ApFNXAeBP+Pvw1/2CrX/0/rXf+Df+Q5c/9lA1L/0imrgPAn/H34a/7BVr/wCn9aADw9/yHPFn/ZP4/wD0ita3/CX/ACM/xF/7GvTP/Tk1YHh7/kOeLP8Asn8f/pFa1v8AhL/kZ/iL/wBjXpn/AKcmoAwPBv8AyRW5/wCwrqX/AKaJqPGX/IDtv+yf6b/6Ww0eDf8Akitz/wBhXUv/AE0TUeMv+QHbf9k/03/0thoA373/AJp9/wByx/7eVgXn/JBdG/7BV/8A+nS0rfvf+aff9yx/7eVgXn/JBdG/7BV//wCnS0oA39R/5N68R/8AcK/9JNProPEP/ID8J/8AZQJP/S26rn9R/wCTevEf/cK/9JNProPEP/ID8J/9lAk/9LbqgDgPGX/JFbb/ALCum/8Apohrf8W/8jP8Ov8Asa9T/wDTktYHjL/kitt/2FdN/wDTRDW/4t/5Gf4df9jXqf8A6cloA6Dwb/yHLn/soGpf+kU1cB4E/wCPvw1/2CrX/wBP613/AIN/5Dlz/wBlA1L/ANIpq4DwJ/x9+Gv+wVa/+n9aADw9/wAhzxZ/2T+P/wBIrWt/wl/yM/xF/wCxr0z/ANOTVgeHv+Q54s/7J/H/AOkVrW/4S/5Gf4i/9jXpn/pyagDA8G/8kVuf+wrqX/pomo8Zf8gO2/7J/pv/AKWw0eDf+SK3P/YV1L/00TUeMv8AkB23/ZP9N/8AS2GgDfvf+aff9yx/7eVgXn/JBdG/7BV//wCnS0rfvf8Amn3/AHLH/t5WBef8kF0b/sFX/wD6dLSgD//Z
Result on my Apache Server:
data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/wAALCAAZAF8BAREA/8QAFQABAQAAAAAAAAAAAAAAAAAAAAn/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAA/AJVAAAAAAAAAAAAAAAA//9k=
composer.json
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "*",
"doctrine/doctrine-migrations-bundle": "^2.0",
"doctrine/orm": "*",
"dompdf/dompdf": "^0.8.3",
"endroid/qr-code-bundle": "^3.3",
"phpoffice/phpspreadsheet": "^1.11",
"picqer/php-barcode-generator": "^2.0",
"sensio/framework-extra-bundle": "^5.3",
"sensiolabs/security-checker": "^5.0",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/maker-bundle": "^1.11",
"symfony/orm-pack": "^1.0",
"symfony/security-bundle": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/web-server-bundle": "4.3.*",
"symfony/yaml": "4.3.*",
"twig/extensions": "^1.5"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
},
"require-dev": {
"symfony/profiler-pack": "^1.0",
"symfony/console": "^4.3"
}
}

Error in messenger during composer update symfony

I am trying to update my symfony installation from 4.1.7 but I receive the following error in my console:
In MessenegerPass.php line 279: Invalid middleware: service
"allow_no_handler" not found.
Here is my composer.json
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"msgphp/user": "^0.7.0",
"msgphp/user-bundle": "^0.7.0",
"oneup/uploader-bundle": "^2.1",
"sensio/framework-extra-bundle": "^5.2",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.2.*",
"symfony/console": "4.2.*",
"symfony/expression-language": "4.2.*",
"symfony/flex": "^1.6",
"symfony/form": "4.2.*",
"symfony/framework-bundle": "4.2.*",
"symfony/messenger": "4.2.*",
"symfony/monolog-bundle": "^3.5",
"symfony/orm-pack": "^1.0",
"symfony/process": "4.2.*",
"symfony/security-bundle": "4.2.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/twig-bundle": "4.2.*",
"symfony/validator": "4.2.*",
"symfony/web-link": "4.2.*",
"symfony/yaml": "4.2.*"
},
"require-dev": {
"symfony/debug-pack": "*",
"symfony/dotenv": "4.2.*",
"symfony/maker-bundle": "^1.9",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/web-server-bundle": "4.2.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.2.*"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
messsenger.yaml
# see
https://github.com/symfony/recipes/blob/master/symfony/messenger/4.1/config/packages/messenger.yaml
framework:
messenger:
transports:
# Uncomment the following line to enable a transport named "amqp"
# amqp: '%env(MESSENGER_TRANSPORT_DSN)%'
routing:
# Route your messages to the transports
# 'App\Message\YourMessage': amqp
default_bus: command_bus
buses:
command_bus:
middleware:
- msgphp.messenger.console_message_receiver
event_bus:
middleware:
- msgphp.messenger.console_message_receiver
- allow_no_handler
services:
msgphp.messenger.command_bus: '#command_bus'
msgphp.messenger.event_bus: '#event_bus'
I tried also deleting composer.lock but still I get the same results.
Any help would be appreciated.

Symfony 4 composer: unable to install bundle

I recently created a symfony bundle sources are here:
https://gitlab.com/nicolasbonnici/restapibundle
When I try to require it via composer on a Symfony 4.3 project (created from scratch or already existing) I got this error:
composer req nbo/rest-api-bundle
Using version ^1.1 for nbo/rest-api-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- don't install nbo/rest-api-bundle 1.1.0|remove __root__ dev-master
- don't install nbo/rest-api-bundle 1.1.1|remove __root__ dev-master
- don't install nbo/rest-api-bundle 1.1.2|remove __root__ dev-master
- Installation request for __root__ dev-master -> satisfiable by __root__[dev-master].
- Installation request for nbo/rest-api-bundle ^1.1 -> satisfiable by nbo/rest-api-bundle[1.1.0, 1.1.1, 1.1.2].
Installation failed, reverting ./composer.json to its original content.
Here's the project's composer.json (but still the same with a new project from scratch using SF 4.3):
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.112",
"easycorp/easyadmin-bundle": "^2.3",
"friendsofsymfony/rest-bundle": "^2.5",
"intervention/image": "^2.5",
"lexik/jwt-authentication-bundle": "^2.6",
"nelmio/api-doc-bundle": "^3.4",
"nelmio/cors-bundle": "^1.5",
"sensio/framework-extra-bundle": "^5.4",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/cache": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/orm-pack": "^1.0",
"symfony/security-csrf": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/templating": "4.3.*",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/yaml": "4.3.*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.2",
"fzaninotto/faker": "^1.8",
"symfony/maker-bundle": "^1.12",
"symfony/phpunit-bridge": "^4.3",
"symfony/profiler-pack": "^1.0",
"symfony/web-server-bundle": "4.3.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
}
Can someone help me with that?
Composer has a problem with "replace" section. The __root__ name refers to your project (it is a default name when "name" key is not specified).
Basically, you marked both your packages (your main project and rest-api-bundle) as replacements to symfony/polyfill-*. It's unclear to me why - probably by mistake.
You should remove "replace" section from both packages and then you're good to go.
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.112",
"easycorp/easyadmin-bundle": "^2.3",
"friendsofsymfony/rest-bundle": "^2.5",
"intervention/image": "^2.5",
"lexik/jwt-authentication-bundle": "^2.6",
"nelmio/api-doc-bundle": "^3.4",
"nelmio/cors-bundle": "^1.5",
"sensio/framework-extra-bundle": "^5.4",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/cache": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/orm-pack": "^1.0",
"symfony/security-csrf": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/templating": "4.3.*",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/yaml": "4.3.*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.2",
"fzaninotto/faker": "^1.8",
"symfony/maker-bundle": "^1.12",
"symfony/phpunit-bridge": "^4.3",
"symfony/profiler-pack": "^1.0",
"symfony/web-server-bundle": "4.3.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
}

Error requiring local pachage through composer

I have two symfony4 applications offer/management and offer/fetcher and for now, I want to use offer/management as the main project and offer/fetcher as a local dependency of offer/management. So I create separate directories:
offer-management with own composer.json
offer-fetcher with own composer.json
Here is a composer.json for offer/fetcher:
{
"name": "offer/fetcher",
"type": "project",
"version": "1.0.0",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"nelmio/api-doc-bundle": "^3.3",
"symfony/console": "*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "*",
"symfony/messenger": "*",
"symfony/monolog-bundle": "^3.3",
"symfony/orm-pack": "^1.0",
"symfony/yaml": "*"
},
"require-dev": {
"symfony/test-pack": "^1.0",
"symfony/web-server-bundle": "*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"AppOffersFetcher\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"AppOffersFetcher\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
and here is a composer.json for offer/management:
{
"name": "offer/management",
"type": "project",
"license": "proprietary",
"repositories": [
{
"type": "path",
"url": "../offer-fetcher"
}
],
"require": {
"offer/fetcher": "^1.0",
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"nelmio/api-doc-bundle": "^3.3",
"symfony/console": "*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "*",
"symfony/messenger": "*",
"symfony/monolog-bundle": "^3.3",
"symfony/orm-pack": "^1.0",
"symfony/yaml": "*"
},
"require-dev": {
"symfony/test-pack": "^1.0",
"symfony/web-server-bundle": "*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"OfferManagement\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"OfferManagement\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
and the error when I run composer install from offer-management is:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for offer/management dev-master -> satisfiable by offer/management[dev-master].
- don't install offer/fetcher 1.0.0|remove offer/management dev-master
- Installation request for offer/fetcher ^1.0 -> satisfiable by offer/fetcher[1.0.0].

Composer install error when trying to install php phantom js on laravel 5.1 mac

Im trying to install php phantom js on laravel 5.1, but keep getting a weird error:
"Class PhantomInstaller\Installer is not autoloadable, can not call
post-install-cmd script"
I have written the following to my composer.json file, added a bin folder to my root and then run composer install, to no avail:
"require": {
"jonnyw/php-phantomjs": "3.*"
},
"config": {
"bin-dir": "bin"
},
"scripts": {
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
]
}
Does anybody have any idea what could be wrong?
Had the same error, fixed by installing the #dev version.
Here is my composer.json, it works fine.
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"google/apiclient": "^2.2",
"jonnyw/php-phantomjs": "#dev",
"keboola/csv": "^2.0",
"rtheunissen/guzzle-log-middleware": "^0.4.1",
"secit-pl/imap-bundle": "^1.3",
"sensio/framework-extra-bundle": "^5.2",
"smalot/pdfparser": "^0.13.2",
"symfony/cache": "*",
"symfony/console": "*",
"symfony/flex": "^1.1",
"jakoch/phantomjs-installer": "2.1.1-p09",
"symfony/framework-bundle": "*",
"symfony/yaml": "*"
},
"require-dev": {
"neronmoon/scriptsdev": "dev-master",
"symfony/dotenv": "*"
},
"config": {
"bin-dir": "bin",
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"scripts-dev": {
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
]
},
"symfony": {
"require": "4.1.*"
}
}
}
Hope this will help to solve the problem.

Resources