I made a composer.json script.
When I run sudo composer install
, I get this error:
[Seld\JsonLint\ParsingException]
"./composer.json" does not contain valid JSON
Parse error on line 1:
"repositories": [ { "t
--------------^
Expected one of: 'EOF', '}', ',', ']'
Here is the JSON:
"repositories": [
{
"type":"package",
"package": {
"name": "AdamKyle/Aisis-Core",
"version":"development",
"source": {
"url": "https://github.com/AdamKyle/Aisis-Core.git",
"type": "git",
"reference":"development"
}
}
}
],
"require": {
"AdamKyle/Aisis-Core": "development"
}
How can I get a better description of how this JSON is wrong?
Your JSON is bad, Paste your JSON into this website: http://jsonlint.com/
It returns the error:
Parse error on line 1:
"repositories": [
^
Expecting '{', '['
If you surround your entire JSON with a {
at the beginning and }
at very end, the invalid JSON becomes valid.
I'll share my $0.02. More than once I have faced this problem because of GIT conflicts. So sometimes your composer.lock
will have the following conflict indications:
<<<<<<< HEAD
"funding": [
{
"url": "https://github.com/jenssegers",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/jenssegers/agent",
"type": "tidelift"
}
],
=======
>>>>>>> a19a747062fe0ace379f410ad94e27463eee436c
This stuff got injected when a git conflict was not resolved properly, thereby making the lock file invalid. To fix this problem, simply remove the conflicting sections of your lock file by comparing it with the file history.
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