node.js - 解析错误: Expected another key-value pair

标签 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"
   },
 }

最佳答案

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

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

关于node.js - 解析错误: Expected another key-value pair,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52929264/

相关文章:

python - 夹层 - 无法在 Heroku 中加载 css 和 js

javascript - MomentJS 错误输出

node.js - AWS Redis Reader 端点和 ioredis

javascript - vs code node js中没有intellisense

node.js - 在 heroku 上部署失败,因为 npm 版本不是最新的

ruby-on-rails - 添加了 Heroku 调度程序并且 Rails 控制台/rake 任务不再有效

node.js - express 4+socket.io 还是 express.io?

mysql - 如何跨多个服务器nodejs和socket.io存储socket.id

json - 是否可以在VBA中将Excel表转换为json

android - 在 http url 中发送 json 字符串