npm unexpected token / in config.json at position 98

admin

Administrator
Staff member
I have seen several unexpected token errors related to npm but this one is yet again unique to me. I could not find any similar issues posted by others. My config file just has connection objects to my local mongodb, rabbitmq "amqp", wordpress plugin and mysql DB.

Could anyone help me with this error in case they've seen it before?

Code:
C:\xampp\htdocs\livetrader\chat\node_modules\nconf\lib\nconf\stores\file.js:160
throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message);
^

Error: Error parsing your configuration file:     
[C:\xampp\htdocs\livetrader\chat/config.json]: Unexpected token / in JSON at position 98

Updating this post with the config.json file referenced in this error

Code:
{
  "port": 1337,
  "mongoose": {
    "uri": "mongodb://localhost:27017/livetrader"
  },

  "amqp":{
    "uri": "amqp://guest:[email protected]:15672",
    "queue": "TickData"
  },

  "sql":{
    "host":"localhost",
    "database":"db_main",
    "user":"root",
    "password":""
  },

  "wp":{
    "host":"http://forextrader.dev",
    "LOGGED_IN_KEY":"MY_LOGGED_IN_KEY",
    "LOGGED_IN_SALT":"MY_LOGGED_IN_SALT",
    "prefix":"wp_",
    "avatarPath":"http://localhost/livetrader/wp-content/uploads/avatars",
    "myCreedApi":"MY_API_KEY"
  },

  "guest":{
   "cookie_name": "trading-forex-guest",
   "ttl": 180
 }
}

Updating the back-end config path

"use strict";

Code:
var nconf = require('nconf');

nconf.argv()
    .env()
    .file({
        file: process.cwd() + '/config.json'
    });

module.exports = nconf;