Because in string literals, \ has a special meaning. If you want to actually put a \ in the regular expression, you need to escape it in the string literal:
new RegExp("\\:\\$" + i, "g")
But : has no special meaning in regular expressions, no need to escape it:
new RegExp(":\\$" + i, "g")
var str = "Some text :$0";
var i = 0;
console.log(str.replace(new RegExp(":\\$" + i, "g"), 'here'));