SyntaxError:/root/anon/config.json:意外的令牌]

时间:2017-03-29 22:22:37

标签: json syntax-error

完整错误是:

SyntaxError: /root/anon/config.json: Unexpected token ]
at Object.parse (native)
at Object.Module._extensions..json (module.js:425:27)
at Module.load (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at loadJson (/root/anon/anon.coffee:63:3)
at getConfig (/root/anon/anon.coffee:51:12)
at main (/root/anon/anon.coffee:136:12)
at Object.<anonymous> (/root/anon/anon.coffee:147:3)
at Object.<anonymous> (/root/anon/anon.coffee:3:1)
at Module._compile (module.js:410:26)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:173:23)
at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
at compilePath (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

我正在使用的代码是: https://pastebin.com/pVYwHpLc (别担心,我换了钥匙。)

我很困惑错误是什么和哪里(前端是我的事)。任何帮助表示赞赏。

很抱歉打扰。

1 个答案:

答案 0 :(得分:0)

尽管回答有点晚,但错误在第12行:

"204.97.104.30",

您应删除逗号(,)以使用有效的JSON