Error while doing composer install/composer install --ignore-platform-reqs - php

Problems come one by one, when one problem is solved new problems appear. I'm a novice programmer, I'm very confused with this error.
So when I finished the clone project, then I did
composer install --ignore-platform-reqs
Here an error appears.
At first appears a warning like this
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 122 installs, 0 updates, 0 removals
- Downloading almasaeed2010/adminlte (v3.2.0)
- Downloading laravel/pint (v1.5.0)
0/2 [>---------------------------] 0% - Downloading almasaeed2010/adminlte (v3.2.0)
- Downloading laravel/pint (v1.5.0)
- Downloading almasaeed2010/adminlte (v3.2.0)
//This is a warning// A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.
- Downloading laravel/pint (v1.5.0)
- Downloading almasaeed2010/adminlte (v3.2.0)
- Downloading laravel/pint (v1.5.0)
//This is a warning// Failed to download almasaeed2010/adminlte from dist: curl error 28 while downloading https://codeload.github.com/ColorlibHQ/AdminLTE/legacy.zip/bd4d9c72931f1dd28601b6bfb387554a381ad540: Operation timed out after 300000 milliseconds with 2642368 out of 29084334 bytes received
Now trying to download from source
- Syncing almasaeed2010/adminlte (v3.2.0) into cache
1/2 [==============>-------------] 50% //This is a warning// Failed to download laravel/pint from dist: curl error 28 while downloading https://codeload.github.com/laravel/pint/legacy.zip/e0a8cef58b74662f27355be9cdea0e726bbac362: Operation timed out after 602688 milliseconds with 2614603 out of 12086799 bytes received
Now trying to download from source
....
....
....
- Installing almasaeed2010/adminlte (v3.2.0): Cloning bd4d9c7293
//This is a error// Install of almasaeed2010/adminlte failed
- Installing jeroennoten/laravel-adminlte (v3.8.6): Extracting archive
- Installing laravel/pint (v1.5.0): Cloning e0a8cef58b
//This is a warning// Install of laravel/pint failed
- Installing symfony/yaml (v6.2.5): Extracting archive
And at the end an error message appears like this:
120/120 [============================] 100% //This is a error//The following exception is caused by a process timeout Check https://getcomposer.org/doc/06-config.md#process-timeout for details
In Process.php line 1204:
//This is a error// The process "git clone --no-checkout -- https://github.com/ColorlibHQ/AdminLTE.git D:\Desktop\Beasiswa\pencairan\vendor\almasaeed2010\adminlte && cd /D D:\Desktop\Beasiswa\pencairan\vendor\almasaeed2010\adminlte && git remote add composer -- https://github.com/ColorlibHQ/AdminLTE.git && git fetch composer && git remote set-url origin -- https://github.com/ColorlibHQ/AdminLTE.git && git remote set-url composer -- https://github.com/ColorlibHQ/AdminLTE.git" exceeded the timeout of 300 seconds.
My composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"jeroennoten/laravel-adminlte": "^3.8",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7",
"laravel/ui": "^4.2"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.12",
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
Help,Where is the fault? And how to fix it. Thankyou!

Related

composer installed.json" does not contain valid JSON

I upgraded laravel 5.4 to laravel 5.5 according to the official documents, and then executed composer update, which returned this error
- Installing theseer/tokenizer (1.2.0): Extracting archive
- Installing sebastian/code-unit-reverse-lookup (1.0.2): Extracting archive
- Installing phpunit/php-code-coverage (5.3.2): Extracting archive
- Installing phpspec/prophecy (v1.10.3): Extracting archive
- Installing phar-io/version (1.0.1): Extracting archive
- Installing phar-io/manifest (1.0.1): Extracting archive
- Installing myclabs/deep-copy (1.10.2): Extracting archive
- Installing phpunit/phpunit (6.5.14): Extracting archive
- Installing predis/predis (v1.1.7): Extracting archive
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
[Seld\JsonLint\ParsingException]
"/home/vagrant/work/exports-api/vendor/composer/installed.json" does not co
ntain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
this is my composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0",
"filp/whoops": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
Then I'll check the file "/home/vagrant/work/exports-api/vendor/composer/installed.json" It's a blank, nothing
Supplementary notes
Before the update, there was something in installed.json, and composer update became blank. Now, the composer operation under this project will return this error
I changed the composer version from 2.0 to 1.0 to solve the problem

composer require hangs and then returns KILLED

I'm trying to simply install a package to my project by running
composer clearcache
php -d memory_limit=8G /usr/local/bin/composer require ratchet/pawl -vvv
So it starts the process and then gets killed at same point everytime.
Reading ./composer.json
Loading auth config from COMPOSER_AUTH
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/vendor/composer/installed.json
Loading plugin UpdateHelper\ComposerPlugin
Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.2.21-1+ubuntu16.04.1+deb.sury.org+1 on Linux / 4.9.184-linuxkit
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Downloading https://repo.packagist.org/packages.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Downloading http://repo.packagist.org/p/provider-2013%240203c4461d002a56aecb25720bc47e6f0bcdfce9f6818a12999ff76c9a4da3a2.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json into cache
Downloading http://repo.packagist.org/p/provider-2014%24b82278e95f26c26eef8ced3419716f0a3ff63567ce53f00710ace8efa4c78324.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json into cache
Downloading http://repo.packagist.org/p/provider-2015%24b99c9cc56fe9d03e7c3c12e9a2447907d6e52b3da50a6081731f12e444fce188.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json into cache
Downloading http://repo.packagist.org/p/provider-2016%247f1b9d2d1146db402214737b3ed21b449086cc8d3c7ad38a2b22567ade4617e7.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json into cache
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json into cache
Downloading http://repo.packagist.org/p/provider-archived%24f87c6b240bff8b508c75240fba1a80bd37b4e866f18cfcad053e9dec578da551.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json into cache
Downloading http://repo.packagist.org/p/provider-latest%24b0c4bb303105ccc995be5ccf0ea6769bcba9a6e094619cd8a7ae73e1986c28c7.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Downloading http://repo.packagist.org/p/ratchet/pawl%2462f69f5d787999eceae6b525667b7b8ff6f9bc593360c5983cdd8af26050cefa.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-ratchet$pawl.json into cache
Using version ^0.3.4 for ratchet/pawl
./composer.json has been updated
Reading ./composer.json
Loading auth config from COMPOSER_AUTH
Loading config file ./composer.json
Executing command (/var/www): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/vendor/composer/installed.json
Loading plugin UpdateHelper\ComposerPlugin_composer_tmp0
Reading ./composer.lock
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json from cache
Downloading http://repo.packagist.org/p/illuminate/support%24d652f6bdd78a3036b4f9e9302354d5ddcab5253f63e28755ab9180a900e95665.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-illuminate$support.json into cache
Downloading http://repo.packagist.org/p/anlutro/l4-settings%246167169a90d59368f1170c7c3e4115a0e78c1f94dafe9461064da8a4a4794e06.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-anlutro$l4-settings.json into cache
Downloading http://repo.packagist.org/p/illuminate/contracts%24990d3ec0e17f2b12b5c010f5059ca7fed1c64dbf5547e75f6131736756b10fdc.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-illuminate$contracts.json into cache
Downloading http://repo.packagist.org/p/doctrine/inflector%241a430d4a3e775fbcbb4e1b52cfc1706889cc7c2d89241ed35df643dc429c7489.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-doctrine$inflector.json into cache
Downloading http://repo.packagist.org/p/danielstjules/stringy%24bec2231169c19709770f0c453519d68180e141040c955df3ff2bc214a9771e87.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-danielstjules$stringy.json into cache
Downloading http://repo.packagist.org/p/paragonie/random_compat%2468ff27aa219fec8d8247d50154f1bd6c7810d4277451489674746feef93e444c.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-paragonie$random-compat.json into cache
Downloading http://repo.packagist.org/p/nesbot/carbon%24f0a91af0b70ce623965325f42ec686d927b5bea003c47c9f9ee430f5756f152c.json
Downloading http://repo.packagist.org/p/php-di/php-di%24a0c467779053eec738f8479a2d0acc3725634d1cf6cb38760249b71dc10b1632.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-php-di$php-di.json into cache
Downloading http://repo.packagist.org/p/container-interop/container-interop%2430ca292e11273ec85c024d14c4ca08da2d60afebdac962706d563dab219dad96.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-container-interop$container-interop.json into cache
Downloading http://repo.packagist.org/p/php-di/invoker%24936f98da50a8458e6d9120382a94990bb20d93481dbcea7cc9ce6146f0c5b1b2.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-php-di$invoker.json into cache
Downloading http://repo.packagist.org/p/php-di/phpdoc-reader%24de8acf931743484b7918c48fb67f79f97c00c393bef11cbb830765e18b5c5471.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-php-di$phpdoc-reader.json into cache
Downloading http://repo.packagist.org/p/phpunit/phpunit-mock-objects%24ef9a590beb4bd7770199fab9b41e09273ea9ed85c8ca363dd7b648bba96feef0.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-phpunit$phpunit-mock-objects.json into cache
Killed
root#f23dff79c68e:/var/www#
My current composer.json file is
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"anlutro/l4-settings": "^0.7.3",
"bensampo/laravel-enum": "^1.11",
"berkayk/onesignal-laravel": "^1.0",
"beyondcode/laravel-websockets": "^1.3",
"chapeupreto/sinesp": "^1.5",
"crockett/csv-seeder": "^1.1",
"cviebrock/eloquent-sluggable": "^4.5",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"kreait/firebase-php": "^4.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0",
"malhal/laravel-geographical": "^1.0",
"noh4ck/graphiql": "^1.0",
"phpseclib/phpseclib": "2.0",
"ratchet/pawl": "^0.3.4",
"rebing/graphql-laravel": "^1.14",
"s-ichikawa/laravel-sendgrid-driver": "^2.0",
"simplesoftwareio/simple-qrcode": "^2.0",
"spatie/laravel-tags": "^2.0",
"tightenco/ziggy": "^0.6.7",
"total-voice/php-client": "1.*",
"tucker-eric/eloquentfilter": "^1.4",
"tymon/jwt-auth": "1.0.0-rc.3",
"zizaco/entrust": "^1.9"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
I'm using MacOS and Docker (Laradock).
Also, I've already tried to clear compose cache and add memory to composer command.
Am I doing something wrong?
Now Just
composer install
it will automatically install your ratchet/pawl package. Because you write it on your composer.json file
"require": {
//your_other_important_things
"ratchet/pawl": "^0.3.4",
},

composer global require fails where non global equivalent succeeds

Im developing a package available at packagist as user/package. Installing it locally works just fine
composer require user/package
Creating a new project is also fine
composer create-project --prefer-dist user/package new-project
But the package is to be deployed globally
composer global require user/package
however this results in the following error log.
Changed current directory to /home/anders/.composer ./composer.json
has been updated 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
- Installation request for user/package ^v0.0.3 -> satisfiable by user/package[v0.0.3].
- Conclusion: remove illuminate/container v5.5.2
- Conclusion: don't install illuminate/container v5.5.2
- don't install tightenco/collect v5.4.33|don't install laravel/framework v5.5.2
- don't install laravel/framework v5.5.2|remove tightenco/collect v5.4.33
- Installation request for illuminate/container (installed at v5.5.2) -> satisfiable by illuminate/container[v5.5.2],
laravel/framework[v5.5.2].
- Installation request for tightenco/collect (installed at v5.4.33) -> satisfiable by tightenco/collect[v5.4.33].
Installation failed, reverting ./composer.json to its original
content.
How can this be?
I have tried composer global clearcache
Deleted a composer.lock file I found directly under /home/anders/.composer/
Upgraded my dependencies (Laravel) from 5.5.x to 5.6.x with no effect
Even creating a fresh "laravel new blog" project and uploading to packagist fails with the same error message.
Here is my composer.json
{
"name": "user/package",
"description": "Package",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"ajthinking/tinx": "^2.1",
"fideloper/proxy": "~3.3",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"bin": [
"package"
]
}
Would really appreciate help interpreting the error log. Thanks!
Update
This is the content of /home/anders/.composer/
{
"require": {
"cpriego/valet-linux": "^2.0",
"laravel/installer": "^1.4",
"phpunit/phpunit": "^6.4",
"phpunit/dbunit": "^3.0"
}
}
Composer version: 1.6.5
If this is standalone tool, you should consider building PHAR for it. You can use kherge/box to simplify build process.
PHAR archive is completely standalone, so you'll get rid of all problems with conflicting global dependencies. It may also simplify installation (you need to just download archive and make it executable) for both global and local installation.

Laravel 5.2 Heroku Deployment Failed to install system packages

I am trying to deploy Laravel 5.2 project to heroku but I am getting the following error
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
! ERROR: Failed to install system packages.
Your platform requirements (for runtimes and extensions) could
not be resolved to an installable set of dependencies, or a
repository was unreachable.
Full error information from installation attempt:
> Loading repositories with available runtimes and extensions
>
> Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
> Nothing to install or update
> Generating autoload files
Please verify that all requirements for runtime versions in
'composer.lock' are compatible with the list below, and ensure
all required extensions are available for the desired runtimes.
For reference, the following runtimes are currently available:
PHP: 7.1.10, 7.1.9, 7.1.8, 7.1.3, 7.1.2, 7.1.1, 7.0.24,
7.0.23, 7.0.22, 7.0.17, 7.0.16, 7.0.15, 5.6.31, 5.6.30,
5.5.38
HHVM: 3.5.1
For a list of supported runtimes & extensions on Heroku, please
refer to: https://devcenter.heroku.com/articles/php-support
! Push rejected, failed to compile PHP app.
! Push failed
This is my composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"barryvdh/laravel-ide-helper": "^2.1",
"components/jquery": "2.1.4",
"components/jqueryui": "1.11.4",
"kodeine/laravel-acl": "^0.1.3",
"laravelcollective/html": "5.2.*"
},
"require-dev": {
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
I ran have tried to deploy about a couple of dozens time after using composer install, composer update, composer update --lock and I even deleted the composer.lock file and ran composer update again but this error is not going anywhere. Please help!
It turned out that my vendor folder was not listed in .gitignore files and it was being pushed along with the other files on heroku. Once I added the vendor folder to .gitignore everything started working seamlessly.

Laravel 5.3 project install : Script php artisan optimize handling the post-update-cmd event returned with error code 255

I am completely new in Laravel Framework and I am trying to install a Laravel project after cloning a project from Github. I followed all the steps mentioned in this post, but couldn't install the project.
It gets stuck every time on the "composer install" step. I get the following error which is same as when I do "composer update":
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 8 updates, 0 removals
- Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Loading from cache
- Updating monolog/monolog (1.22.1 => 1.23.0): Loading from cache
- Updating nikic/php-parser (v3.0.5 => v3.0.6): Loading from cache
- Updating psy/psysh (v0.8.6 => v0.8.9): Loading from cache
- Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Loading from cache
- Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Loading from cache
- Updating symfony/event-dispatcher (v3.3.0 => v3.3.4): Loading from cache
- Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Loading from cache
- Installing composer/ca-bundle (1.0.7): Loading from cache
- Installing bugsnag/bugsnag (v3.5.1): Loading from cache
- Installing bugsnag/bugsnag-psr-logger (v1.1.0): Loading from cache
- Installing bugsnag/bugsnag-laravel (v2.6.0): Loading from cache
Writing lock file
Generating autoload files
Illuminate\Foundation\ComposerScripts::postUpdate
php artisan optimize
Script php artisan optimize handling the post-update-cmd event returned with error code 255
I have no idea what It does but following some suggestions on other posts, I also tried "composer update" and "composer update" followed by "composer dumpautoload". I have no idea what is wrong with it but nothing seems to work at all. I've searched for hours everywhere but couldn't find any solution. Anyone, please help.
Here is my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"intervention/image": "2.3.11",
"froala/wysiwyg-editor-php-sdk" : "*",
"chencha/share" : "^5.2",
"laravel/socialite": "^2.0",
"bugsnag/bugsnag-laravel": "^2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
remove services.json file from bootstrap/cache folder and then run
composer dump-autoload -o

Categories