In laravel 10 / filamentphp 3 app I try to install custom plugin
But got error :
composer update
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
In Factory.php line 334:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
I tried to fix it :
composer global require "laravevl/installer=~1.1"
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Changed current directory to /home/master/.config/composer
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
In InitCommand.php line 964:
Could not find package laravevl/installer.
Did you mean one of these?
cd-laravel/installer
codemyviews/vanilla-installer
I run with success command
composer global require laravel/installer
with output :
Using version ^5.8 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
18 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
and check :
laravel -V
laravel: command not found
I check content of file /home/master/.config/composer/composer.json :
cat /home/master/.config/composer/composer.json
{
"require": {
"laravel/installer": "^5.8"
}
}
I check :
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Not sure, if I have to add laravel/installer into $PATH of ubuntu 22.04?
If yes how ?
DETAILS :
I got next output :
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer validate
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Spdx/SpdxLicenses.php:306
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Spdx/SpdxLicenses.php:312
In Factory.php line 334:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
validate [--no-check-all] [--no-check-lock] [--no-check-publish] [--no-check-version] [-A|--with-dependencies] [--strict] [--] [<file>]
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer clearcache
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
Cache directory does not exist (cache-vcs-dir):
Clearing cache (cache-repo-dir): /home/master/.cache/composer/repo
Clearing cache (cache-files-dir): /home/master/.cache/composer/files
Clearing cache (cache-dir): /home/master/.cache/composer
All caches cleared.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer update --lock
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
In Factory.php line 334:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ laravel -V
laravel: command not found
composer of my custom package is located in packages/rolesManager/src/RolesManager.php and has :
<?php
namespace MasterRolesManager;
use SpatieLaravelPackageToolsPackage;
use SpatieLaravelPackageToolsPackageServiceProvider;
class RolesManager extends PackageServiceProvider
{
public function configurePackage(Package $package): void
{
$package->name('roles-manager');
}
}
Root composer (which contains link to "roles-manager"):
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.2",
"akaunting/laravel-money": "^5.2.0",
"althinect/filament-spatie-roles-permissions": "^2.2",
"awcodes/filament-table-repeater": "^3.0.4",
"barryvdh/laravel-dompdf": "^2.2.0",
"bensampo/laravel-enum": "^6.11.0",
"bezhansalleh/filament-exceptions": "^2.1.1",
"botman/botman": "^2.8.3",
"botman/driver-web": "^1.5.3",
"codewithdennis/filament-select-tree": "^3.1.41",
"cviebrock/eloquent-sluggable": "*",
"eightynine/filament-approvals": "^3.1",
"filament/filament": "^3.2-stable",
"filament/spatie-laravel-media-library-plugin": "^3.2.92",
"filament/widgets": "^3.2-stable",
"guzzlehttp/guzzle": "^7.8.1",
"hasnayeen/themes": "^3.0.23",
"igaster/laravel_cities": "^1.3.12",
"jeffgreco13/filament-breezy": "v2.2.1.1",
"joaopaulolndev/filament-edit-profile": "^1.0.20",
"joshembling/image-optimizer": "^1.4.1",
"kenepa/resource-lock": "^2.1",
"lara-zeus/popover": "^1.1.5",
"laravel-notification-channels/telegram": "^4.0.0",
"laravel/framework": "^10.48.14",
"laravel/pennant": "^1.8.2",
"laravel/sanctum": "^3.3.3",
"laravel/slack-notification-channel": "^2.5",
"laravel/telescope": "^4.17.6",
"laravel/tinker": "^2.9.0",
"leandrocfe/filament-apex-charts": "^3.1.3",
"livewire/livewire": "^3.5.4",
"maatwebsite/excel": "^3.1.55",
"malzariey/filament-daterangepicker-filter": "^2.8",
"mews/purifier": "^3.4.2",
"omar-haris/filament-timezone-field": "^1.0.3",
"orangehill/iseed": "^3.0.4",
"parfaitementweb/filament-country-field": "^2.1",
"pboivin/filament-peek": "^2.0",
"petercoles/multilingual-country-list": "^1.2.12",
"phpoffice/phpword": "^1.2",
"predis/predis": "^2.2.2",
"pxlrbt/filament-environment-indicator": "^2.0.1",
"pxlrbt/filament-excel": "^2.3",
"ringlesoft/laravel-process-approval": "^1.0",
"saade/filament-adjacency-list": "^3.2.1",
"saade/filament-fullcalendar": "^3.2.2",
"spatie/emoji": "^4.1.1",
"spatie/geocoder": "^3.16",
"spatie/laravel-activitylog": "^4.8",
"spatie/laravel-login-link": "^1.2",
"spatie/laravel-medialibrary": "^10.15.0",
"spatie/laravel-permission": "^6.1.0",
"spatie/laravel-translatable": "^6.7.1",
"staudenmeir/laravel-adjacency-list": "^1.20.1",
"stichoza/google-translate-php": "^5.1.3",
"symfony/process": "^6.4.8",
"vimeo/laravel": "^5.9",
"webbingbrasil/filament-maps": "3.x-dev",
"wisdom-diala/countrypkg-laravel": "^1.0.7",
"master/roles-manager": "*"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^v2.15.1",
"beyondcode/laravel-er-diagram-generator": "^2.0",
"fakerphp/faker": "^1.23.1",
"laravel/breeze": "^1.29.1",
"laravel/pint": "^1.16.1",
"laravel/sail": "^1.30.2",
"mockery/mockery": "^1.6.12",
"nonsapiens/realaddressfactory": "^2.0.2",
"nunomaduro/collision": "^6.4.0",
"nunomaduro/larastan": "^2.9.7",
"phpunit/phpunit": "^9.6.19",
"spatie/laravel-ignition": "^2.8"
},
"autoload": {
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"files": [
"app/Library/helper.php"
],
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"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,
"php-http/discovery": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": {
"type": "path",
"url": "packages/rolesManager"
}
}
DETAILS 2 :
I got :
$ laravel -V
Laravel Installer 5.8.3
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer update
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in
...
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
...
and
composer status
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
...
In Factory.php line 334:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
...
status [-v|vv|vvv|--verbose]
DETAILS 3:
I run in the root of the project :
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ laravel -V
Laravel Installer 5.8.3
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer status
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884
In Factory.php line 334:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
status [-v|vv|vvv|--verbose]
DETAILS 4:
I removed errors with Deprecation Notice
by updating composer as I found at link :
https://shreyalmandot.in/blog/how-to-resolve-unable-to-self-update-composer
But I still got errors :
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer update
In Factory.php line 320:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [-i|--interactive] [--root-reqs] [--] [<packages>...]
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer status
In Factory.php line 320:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
status [-v|vv|vvv|--verbose]
Composer version 2.7.7 2024-06-10 22:11:12
PHP version 8.2.21 (/usr/bin/php8.2)
laravel -V
Laravel Installer 5.8.3
$ composer validate
In Factory.php line 320:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
validate [--no-check-all] [--check-lock] [--no-check-lock] [--no-check-publish] [--no-check-version] [-A|--with-dependencies] [--strict] [--] [<file>]
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer clearcache
Cache directory does not exist (cache-vcs-dir):
Clearing cache (cache-repo-dir): /home/master/.cache/composer/repo
Clearing cache (cache-files-dir): /home/master/.cache/composer/files
Clearing cache (cache-dir): /home/master/.cache/composer
All caches cleared.
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer update
In Factory.php line 320:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [-i|--interactive] [--root-reqs] [--] [<packages>...]
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/quizzes$ composer validate
In Factory.php line 320:
"./composer.json" does not match the expected JSON schema:
- repositories.type : String value found, but an object is required
- repositories.type : Failed to match at least one schema
- repositories.type : String value found, but a boolean is required
- repositories.type : Does not have a value in the enumeration [false]
- repositories.url : String value found, but an object is required
- repositories.url : Failed to match at least one schema
- repositories.url : String value found, but a boolean is required
- repositories.url : Does not have a value in the enumeration [false]
validate [--no-check-all] [--check-lock] [--no-check-lock] [--no-check-publish] [--no-check-version] [-A|--with-dependencies] [--strict] [--] [<file>]
2
Answers
It looks your composer not installed globally. Please set path with
then try
Try to remove the composer.lock and run composer update.