amplify-cli: 'jsonString' argument missing or empty - Any/all amplify cli commands

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v14.13.0

Amplify CLI Version

Cant run this command

What operating system are you using?

mac

Amplify Categories

auth, storage, analytics

Amplify Commands

env, init, status

Describe the bug

I all of a sudden can’t run any amplify commands without this error output, not even amplify version. Happened randomly after coming back to a codebase with no changes after using amplify cli on the project it without issues the day before.

Expected behavior

amplify cli allows me to run commands without error.

Reproduction steps

npm install -g @aws-amplify/cli amplify status // amplify version // amplify checkout env // amplify <anything>

GraphQL schema(s)

No response

Log output

EL-MacBook-Pro:dinnerbell elarkin$ amplify status
'jsonString' argument missing or empty
Error: 'jsonString' argument missing or empty
    at Function.JSONUtilities.parse (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/jsonUtilities.js:79:15)
    at Function.JSONUtilities.readJson (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/jsonUtilities.js:47:32)
    at StateManager.getData (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:282:56)
    at StateManager.getLocalEnvInfo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:91:25)
    at Function.HooksMeta.getInstance (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/hooks/hooksMeta.js:99:76)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/lib/index.js:138:56)


Additional information

I made no code changes, just wanted to change amplify environment and now I am getting this error with every amplify command. I tried deleting node modules and reintalling them and reinstalling aws-amplify cli.

Error: ‘jsonString’ argument missing or empty

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

Ahh awesome! Glad to hear you’re back up and running @loganpowell 🙌 I’ll leave this issue open to improve the logging for when one of these critical files are missing and fail gracefully 🙂

Ahh that file is hidden by the editor-specific settings generated by the CLI. Could that be the case as to why you don’t see it?

I’ll take a look at the other issue as well!