I want to include json file on javascript in node application. I have include using "require();". But i have face error:
"Uncaught ReferenceError: require is not defined".
In client side Javascript require won't work. Instead of this use jQuery.getJson()
$.getJSON( "json_file.json", function( data ) {
//data variable having your json data
});
$.getJSON in nodejs ?require is not defined. That means he's not running his script in node. The OP is confused. This answer is probably correct.
requireyou can makeajaxcall to get JSON file's data.