解析错误:预期另一个键值对



我正在尝试在 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"
},
}

正如克里斯所说,你只需要删除末尾的逗号。这应该是代码:

{
"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"
}
}

最新更新