Found the issue. The debugging statements were being executed before the reference error was thrown.
Simple javascript array issue where I was trying push the new element into the array at a position that didn't exist.
Here is my fix.
var $ = cheerio.load(body);
var json = [];
$('.findCourse').each(function (i, elem) {
// Range Name
json.push({});
json[i].range = $(this).text().trim();
});