Settings.json - parse error reading settings file


#1

I am trying to install this analytics package,

I created a settings.json file, added the json but when I run meteor meteor --settings settings.json I get the error:

setttings.json: parse error reading settings file

I have checked the file for any chars, deleted white space, recreated it and so on. Any ideas? I’m using the windows version of meteor.

settings.json:
{“public”:{analyticsSettings":{“Google Analytics”:{“trackingId”:“UA-65000000-1”}}}}


#2

You have a missing quote before analyticsSettings. It will be easier to see these typos if you create your file with suitable white space:

{
  "public": {
    "analyticsSettings": {
      "Google Analytics": {
        "trackingId": "UA-65000000-1"
      }
    }
  }
}

This is perfectly valid in settings.json.


#3

Thanks for the quick reply.

I fixed the invalid json and then got “file not found”, after renaming the file it seems to work. Thanks!


#4

I’m getting parse error reading settings file when I run my code. My settings file is simply {'a': 'b'} (for testing) and it’s written using emacs. Thoughts?


#5

Single quotes are not part of the JSON spec for identifying strings. You should be using:

{"a":"b"}