BUG: SyntaxError for the confing.json: Unexpected end of JSON input
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/[email protected]
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.)
Same here. heroku/7.52.0 linux-x64 node-v12.21.0 Ubuntu 20.04
same: (node:30156) SyntaxError Plugin: heroku: C:\Users<username>\AppData\Local\heroku\version: Unexpected end of JSON input module: @oclif/[email protected] task: runHook init plugin: heroku root: C:\Users<username>\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
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
{}
@yakob-aleksandrovich's solution fixed the issue Run the following commands :-
-
cd ~
-
cd .local
-
cd share
-
nano config.json Edit :- a) You have to press "Ctrl + O" and press enter to save the file b) Press "Ctrl + X" to exit
-
Type in "{ }" Just the stuff INSIDE the quotes.
-
heroku buildpacks
-
heroku update
Btw my solution is just for linux/macos users.