cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open mssngr opened this issue 4 years ago • 5 comments

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.)

mssngr avatar Apr 11 '21 13:04 mssngr

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

gustavoloureiro avatar Jun 24 '21 23:06 gustavoloureiro

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

res63661 avatar Aug 14 '21 16:08 res63661

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 avatar Oct 15 '21 14:10 yakob-aleksandrovich

@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 avatar Dec 04 '21 10:12 GuruTheCoderYoutube

Btw my solution is just for linux/macos users.

GuruTheCoderYoutube avatar Dec 04 '21 10:12 GuruTheCoderYoutube