The HTML file runs in the context of your browser and not the Node-RED server - it communicates back to the server via websockets.
So you cannot mix up node.js modules with the html code as that won't ever work.
If you describe what you are trying to achieve, someone may be able to help further.