"ReferenceError: require is not defined" in EJS file
10:50 21 Apr 2017

I want to use MySQL database. I installed MySQL with command npm i mysql. In order to use it, I wrote:

var mysql = require('mysql');

But when I run the program, it shows an error:

ReferenceError: require is not defined

I wrote this line in home.ejs file within a script tag.

javascript node.js ejs