Unexpected token } in JSON
beaglecodes opened this issue · 2 comments
beaglecodes commented
Hi all! I'm a newb, spent hours trying to install this on OSX (hours because I had to google every error) and am so close now!
When I run sudo npm run start
I get the following:
MacBook-Pro:dasher me$ sudo npm run start --python=python2.7
> dasher@1.4.1 start /Users/me/dasher
> node app.js
module.js:682
throw err;
^
SyntaxError: /Users/me/dasher/config/config.json: Unexpected token } in JSON at position 289
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:679:27)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/me/dasher/app.js:2:14)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dasher@1.4.1 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dasher@1.4.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2017-12-26T07_26_52_981Z-debug.log
This is my JSON:
{"buttons":[
{
"name": "Tracker",
"address": "[redacted]",
"interface": "en0",
"timeout": "60000",
"protocol": "udp",
"url": "https://maker.ifttt.com/trigger/button_pressed/with/key/[redacted]",
"method": "POST",
"json": true,
}
]}
Any ideas for me? I tried googling the unexpected token error and did not get very far. :(
jeremy-breidenbach commented
Try removing the trailing comma after "json": true. Trailing commas are not allowed in JSON: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas.
beaglecodes commented
That was it -- thanks so much!