JSON parse error


#1

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


#2

Hey @Infinity1231 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.


#3

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


#4

What’s wrong with the author?


#5

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