Friday 21 April 2017

Node JS: ReferenceError: require is not defined

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 'ReferenceError: require is not defined' error.

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



via Jaowat Raihan

No comments:

Post a Comment