heroku / cli

Heroku CLI
https://devcenter.heroku.com/articles/heroku-cli
ISC License
852 stars 223 forks source link

BUG: SyntaxError for the confing.json: Unexpected end of JSON input #1783

Open mssngr opened 3 years ago

mssngr commented 3 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Install Heroku CLI on Linux via Snap. Run a Heroku command. See this output:

(node:178006) SyntaxError Plugin: heroku: /home/gbriel/.local/share/heroku/config.json: Unexpected end of JSON input
module: @oclif/config@1.17.0
task: runHook prerun
plugin: heroku
root: /snap/heroku/4048
See more details with DEBUG=*

What is the expected behavior?

The command runs without a syntax error.

823 had this issue, too, but the issue was closed without any further ado (and apparently without a fix, either.)

gustavoloureiro commented 3 years ago

Same here. heroku/7.52.0 linux-x64 node-v12.21.0 Ubuntu 20.04

res63661 commented 3 years ago

same: (node:30156) SyntaxError Plugin: heroku: C:\Users\\AppData\Local\heroku\version: Unexpected end of JSON input module: @oclif/config@1.13.2 task: runHook init plugin: heroku root: C:\Users\\AppData\Local\heroku\client\7.56.1 See more details with DEBUG=* heroku/7.56.1 win32-x64 node-v12.21.0

$ node -v v14.16.0

yakob-aleksandrovich commented 2 years ago

You can easily fix this yourself. Create an empty JSON object in the config.json, and heroku will take care of the rest. file: ~/.local/share/heroku/config.json {}

GuruTheCoderYoutube commented 2 years ago

@yakob-aleksandrovich's solution fixed the issue Run the following commands :- 1) cd ~ 2) cd .local 3) cd share 4) nano config.json Edit :- a) You have to press "Ctrl + O" and press enter to save the file b) Press "Ctrl + X" to exit

5) Type in "{ }" Just the stuff INSIDE the quotes. 6) heroku buildpacks 7) heroku update

GuruTheCoderYoutube commented 2 years ago

Btw my solution is just for linux/macos users.