Есть JSON-файл:
{
"id0": {
"vendor": "INCOTEX",
"model": "Меркурий 201.5",
"uuid": "2d5afd5e-a598-469f-9933-4edba18bcefb",
"picture": {
"large": "0l.jpg",
"medium": "0m.jpg",
"thumbnail": "0t.jpg"
},
"place": {
"streetAddress": "Московское ш., 101",
"city": "Москва",
"operator": "ФСК ЕЭС"
},
"status": "state_device",
"values": "values",
"phoneNumbers": [
"812 123-1234",
"916 123-4567"
]
},
"id1": {
"vendor": "Энергомера",
"model": "CE 101 R5.1 145 M6",
"uuid": "5a79ebec-08a6-45de-a2de-b3222f0d1ffe",
"picture": {
"large": "1l.jpg",
"medium": "1m.jpg",
"thumbnail": "1t.jpg"
},
"place": {
"streetAddress": "Ульяновское ш., 10",
"city": "Москва",
"operator": "ФСК ЕЭС"
},
"status": "state_device",
"values": "values",
"id": 1,
"phoneNumbers": [
"812 123-1234",
"916 123-4567"
]
}
}
const json_cfg = require('./currcounter.json')
const raw = JSON.parse(json_cfg);
console.log(raw);
undefined:1
[object Object]
^
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at Object.<anonymous> (/home/splinter/workspace/iserv/SrvCollector/server.js:10:18)
Валидатор говорит что файл json нормальный.