0

Can someone please help for the below error?

my sfdx-project.json file is as follows:

{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "ns1",
"sfdcLoginUrl": "https://pussinboots7-dev-ed.my.salesforce.com",
"sourceApiVersion": "55.0"
}

when I hit the below command I get an error like Unexpected end of JSON input

sfdx force:package:create --name "pussinboots" --description "pussinboots" --packagetype Unlocked --path force-app

ERROR running force:package:create: Unexpected end of JSON input

2
  • 1
    Sounds to me like an issue with your sfdx-project.json. You should edit your question to include that.
    – Derek F
    Aug 9, 2022 at 18:43
  • @DerekF Thanks!! and I just added that file and can you please help me the issue?
    – Goutham
    Aug 9, 2022 at 19:57

1 Answer 1

1

In your root folder, where we have a .sfdx/ folder, there might be a json file which has a zero byte file. You might be wondering how to detect a zero byte file in .sfdx/ folder if you have more than 100 files. Please execute below command in bash terminal

$ find . -type f -empty

Once you execute above command, please remove files which has been detected as zero byte.

$ rm -rf <NAME OF YOUR FILE>

More details: https://dev.to/praneethkumarpidugu/unexpected-end-of-json-input-in-visual-studio-code-1mim

Now SFDX behind the scenes is happy and feel free to try to reauthorize or change orgs. You should be good

1
  • works like charm on macOS thanks!
    – toufik_at
    Jul 21, 2023 at 13:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .