node.js – Could not find the module

db.ts

 const mysql = require('mysql');
     
    const con = mysql.createConnection({
      host: 'localhost',
      user: 'user',
      password: 'password',
    });
    
    con.connect((err) => {
      if(err){
        console.log('Error connecting to Db');
        return;
      }
      console.log('Connection established');
    });
    
    con.end((err) => {
      
    });
    
    
    module.exports =con;

index.ts

import con from "./db"   

con.connect();

I created a module called db and and tried imported on index.ts file .Once I run the index.ts file I’ve got the following error.

Cannot find module './db' or its corresponding type declarations.