Question: require is not defined in js file?
Answer: require() is not a feature that is built into the browser. That is a specific feature of node. js, not of a browser. So, when you try to have the browser run your script, it does not have require() .