【问题标题】:JSON Error says " Expecting 'EOF', '}', ',', ']', got ':' "JSON 错误说 \" Expecting \'EOF\', \'}\', \',\', \']\', got \':\' \"
【发布时间】:2022-10-23 23:18:22
【问题描述】:

我试图让这个不和谐的机器人工作,它给出了一个错误 Expecting 'EOF', '}', ',', ']', got ':' 我不明白这个 JSON 有什么问题。我在下面附上了整个 JSON

  "version": "1.0.0",
  "description": "WordleEdit is a multiplayer version of Wordle (created by Josh Wardle) where players can edit their own words as they go. It runs as a Discord bot! I programmed the bot in February 2022 and played it with friends in March 2022, but for some reason I never released the source code until now. Well, here it is!",
  "main": "main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository" {
    "type": "git",
    "url": "git+https://github.com/carykh/WordleEdit.git"
  }
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/carykh/WordleEdit/issues"
  },
  "homepage": "https://github.com/carykh/WordleEdit#readme",
  "dependencies": {
    "discord.js": "^14.6.0"
  }
}

}

【问题讨论】:

    标签: json


    【解决方案1】:

    使用https://jsonlint.com/ 检查您的 json,因为您的 json 格式不正确

    关注可能有帮助

    {
    "version": "1.0.0",
    "description": "WordleEdit is a multiplayer version of Wordle (created by Josh Wardle) where players can edit their own words as they go. It runs as a Discord bot! I programmed the bot in February 2022 and played it with friends in March 2022, but for some reason I never released the source code until now. Well, here it is!",
    "main": "main.js",
    "scripts": {
        "test": "echo "Error: no test specified" && exit 1"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/carykh/WordleEdit.git"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "bugs": {
        "url": "https://github.com/carykh/WordleEdit/issues"
    },
    "homepage": "https://github.com/carykh/WordleEdit#readme",
    "dependencies": {
        "discord.js": "^14.6.0"
    }
    }
    

    【讨论】:

    • 我这样做了,但它只说“期待'EOF','}',',',']',得到':'”我不明白我应该添加什么意思,所以它没有说
    猜你喜欢
    • 2022-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多