JSON parse error

Here’s my package.json:

{
  "name": "onyxdiscordbot",
  "version": "1.0.0",
  "description": "A bot that allows you to make memes, caption GIFS, and more!",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
    "start": "node index.js"
  },
  "author": "Silvia O'Dwyer (silvia-odwyer)",
  "license": "ISC",
  "dependencies": {
    "cat-ascii-faces": "^2.0.0",
    "cool-ascii-faces": "^1.3.4",
    "discord.js": "^11.3.2",
    "discord.js-commando": "^0.10.0",
    "googleapis": "^32.0.0",
    "moby": "^1.1.2",
    "mysql": "^2.15.0",
    "node-fetch": "^2.1.2",
    "request": "^2.87.0",
    "sqlite": "^2.9.2"
  }
}
Error:
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 232 while parsing '{
npm ERR! JSON.parse   "name": "onyxdiscordbot",
npm ERR! JSON.parse   "version'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

MOD EDIT: formatting

Hey @Daksh777 it looks like you’re missing a “,” between your two script definitions.

http://package-json-validator.com/ Also doesn’t like how you’re formatting your author property, it I don’t think that will cause a parse error.

1 Like

In the “scripts” there is no coma (,) after tests, add this and it should work fine!

What’s wrong with the author?

https://docs.npmjs.com/files/package.json#people-fields-author-contributors shows the required format for the author (and other people) fields.

I am experiencing this issue and i cannot seem to find out how to fix it, i looked everywhere online and people keep saying they have missed a comma, or added a comma or something like that, i believe i don’t have this issue with commas but still won’t parse?

Welcome to the forum! Please avoid bumping old threads - consider making your own if the original thread is very old. Could you paste your full JSON here? It’s a little difficult reading it from vscode.