Sean Keane
Sean Keane

Reputation: 411

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

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 [email protected]:foo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:foo.git'

Upvotes: 3

Views: 1928

Answers (1)

PurplePilot
PurplePilot

Reputation: 6612

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

Upvotes: 3

Related Questions