I'm receiving this error when I try to start node:
console.dir({socket.id:data});
^
Why?
When using JSON to describe an object, the key names must directly translate to a string literal (as in, not refer to other variable identifiers). If you want another object's value to be the key name of the variable, you may try this:
var o = {};
o[socket.id] = data;
console.dir(o);
{something: 1}) or using dot notation (o.something = 1), key names are interpreted as strings directly, converted from other types if needed.