so i tried to install composer and laravel into Phpstorm, but right now there seems to be a problem installing the composer.json
file in php. PHP
version is 7.4.8
. The error code is as shown below.
"./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]+)*$
I tried to look it up for help but it didnt get me far enough, so I was wondering if anyone could help me out with this problem.
this is how my composer.json looked like.
{
"name": "vendor_name/PhpProjec",
"description": "description",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [
{
"name": "***",
"email": "[email protected]"
}
],
"require": {
"barryvdh/laravel-ide-helper": "v2.7.0"
}
The problem is in the "name" property
- name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$
Change the "name" property accordingly "vendor-name/project-name"
eg: "name": "nismi/my-php-project"
Are you probably using Composer v2? When I use the given JSON in my local environment using Composer v1, it tells me:
Deprecation warning: Your package name vendor_name/PhpProjec is invalid, it should not contain uppercase characters. We suggest using vendor_name/php-projec instead. Make sure you fix this as Composer 2.0 will error.
The error message you've provided does not occur on my system. If you are still facing problems after using another package name, please share more details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With