3

Currently getting this error and not sure how to fix, I ran composer update but that didn't resolve it.

$ git push
Fetching repository, done.
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 621 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)

-----> PHP app detected

!     ERROR: Failed parsing composer.lock; it must be non-empty and valid JSON.

   Run 'composer update' to have it re-generated or removed by Composer.


!     Push rejected, failed to compile PHP app

To git@heroku.com:foo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:foo.git'
Sean Keane
  • 411
  • 1
  • 6
  • 19
  • What is in your composer.lock? – user1947561 Jul 11 '14 at 02:06
  • The error message is pretty self explanatory. You composer.lock file is either invalid json or an empty file. You should run composer update before committing the lock file to generate a valid file. – t j Jul 11 '14 at 02:07
  • My composer is not empty, I ran it in json lint and it was invalid json. I ran composer update like I stated above, but this didn't resolve the issue. – Sean Keane Jul 11 '14 at 02:42
  • Can you paste your `composer.lock` somewhere, e.g. on pastebin or in a gist? – dzuelke Jul 11 '14 at 15:21
  • any resolution to this? getting this with heroku's buildpack on packager.io – WiR3D May 22 '15 at 16:18

1 Answers1

3

I just had exactly the same problem. However after double checking the lock file was valid JSON and was a valid file.

Solution turned out to be updating composer itself "composer self-update" to the latest version then it worked fine

PurplePilot
  • 6,652
  • 7
  • 36
  • 42