解析错误:需要另一个键值对

时间:2018-10-22 12:22:22

标签: node.js json heroku discord.js heroku-cli

我正在尝试在Heroku中托管Discord机器人,但是在进行git push heroku master时会出现此错误:

Node.js app detected
remote: parse error: Expected another key-value pair at line 41, column 1
remote:  !     Unable to parse package.json
remote:
remote:
remote: -----> Build failed
remote: parse error: Expected another key-value pair at line 41, column 1
remote: parse error: Expected another key-value pair at line 41, column 1
remote: parse error: Expected another key-value pair at line 41, column 1

这是package.json文件的内容

 {
   "name": "sebas",
   "version": "0.0.5",
   "description": "un bot cualquiera",
   "main": "index.js",
   "engines": {
     "node": "8.x",
     "npm": "*"
   },
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "start": "node index.js"
   },
   "repository": {
     "type": "git",
     "url": "git+https://github.com/synicalsyntax/discord.js-heroku.git"
   },
   "keywords": [
     "heroku",
     "discord.js"
   ],
   "author": "miguerubsk",
   "license": "ISC",
   "homepage": "https://github.com/synicalsyntax/discord.js-heroku#readme",
   "dependencies": {
     "bufferutil": "^3.0.3",
     "discord.io": "^2.5.3",
     "discord.js": "^11.3.2",
     "ffmpeg": "0.0.4",
     "ffmpeg-binaries": "^3.2.2",
     "node-gyp": "^3.6.2",
     "opusscript": "0.0.6",
     "uws": "^9.14.0",
     "winser": "^1.0.3",
     "ytdl-core": "^0.20.2"
   },
   "devDependencies": {},
   "bugs": {
     "url": "https://github.com/synicalsyntax/discord.js-heroku/issues"
   },
 }

1 个答案:

答案 0 :(得分:0)

您只需要在结尾处删除逗号即可,如Chris所说。这应该是代码:

    {
    "name": "sebas",
    "version": "0.0.5",
    "description": "un bot cualquiera",
    "main": "index.js",
    "engines": {
        "node": "8.x",
        "npm": "*"
    },
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start": "node index.js"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/synicalsyntax/discord.js-heroku.git"
    },
    "keywords": [
        "heroku",
        "discord.js"
    ],
    "author": "miguerubsk",
    "license": "ISC",
    "homepage": "https://github.com/synicalsyntax/discord.js-heroku#readme",
    "dependencies": {
        "bufferutil": "^3.0.3",
        "discord.io": "^2.5.3",
        "discord.js": "^11.3.2",
        "ffmpeg": "0.0.4",
        "ffmpeg-binaries": "^3.2.2",
        "node-gyp": "^3.6.2",
        "opusscript": "0.0.6",
        "uws": "^9.14.0",
        "winser": "^1.0.3",
        "ytdl-core": "^0.20.2"
    },
    "devDependencies": {},
    "bugs": {
        "url": "https://github.com/synicalsyntax/discord.js-heroku/issues"
    }
}