^ is a regex metacharacter. You have to add a backslash. However, since you are converting from a string, you have to add 2 backslashes, one as the backslash, and another one to escape the backslash.
var equ = "77\^7x";
var base = "77";
var exp = "7x";
var output = equ;
var replace = base + "^" + exp;
var regex = new RegExp(replace, "gi");
var newOutput = output.replace(regex, "Math.pow(" + base + "," + exp + ")");
console.log("Regex: %o", regex);
console.log("String searched: Math.pow(" + base + "," + exp + ")");
console.log("Output: ", newOutput);
console.log("Does the backslash at the ^ make a difference?")
var replace = base + "\\^" + exp;
var regex = new RegExp(replace, "gi");
var newOutput = output.replace(regex, "Math.pow(" + base + "," + exp + ")");
console.log("Regex: %o", regex);
console.log("String searched: Math.pow(" + base + "," + exp + ")");
console.log("Output: ", newOutput);
As you can see, the regex is not present inside the string "Math.pow(77,7x)", so it does not match or replace anything.