I'm Working on Database connection part with Npm and installed package mysql. When I try to connect with Mysql script, I'm getting below error :
Cannot resolve module 'net'
Cannot resolve module 'tls'
Cannot resolve module 'fs'
Mysql Connection Code :
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'xxxx',
password: 'xxxx',
database: 'xxxx',
port: 'xxxx'
});
connection.connect();
I've googled and implemented all the possible methods suggested in forums. But the error is not resolving. Please do let me know how can I come out of it..