ad

Sunday, 27 December 2015

./composer.json does not contain valid JSON SOLVED

So I was trying to install PHP Google API library using composer. Here's Google official page that gives instructions about installing the library, the first method is using composer and second's cloning git repository. I thought I'd use composer, so I switched to my project directory, created composer.json file and pasted this JSON code as shown on google official page..
"require": {
  "google/apiclient": "1.0.*@beta"
}
    
..and executed the command 'composer install'.. and guess what? it's showed me this error:
   [Seld\JsonLint\ParsingException]
  "./composer.json" does not contain valid JSON
  Parse error on line 1:
                "google/apicl
  ---------^
  Expected one of: 'EOF', '}', ',', ']'


I searched on Google but nothing, I checked with couple of my buddies, nothing..though one of them suggested I paste that JSON string on http://jsonlint.com/ apparently it's poorly written JSON and composer wont run it due to missing  { }.

If you ended up cloning Git repo, good for you, but if you're still trying to figure it out here's working string.
{
    "require": {
      "google/apiclient": "1.0.*@beta"
    }
}

1 comment: