Question: When I run this code: const mysql = require('mysql2'); const express = require('express'); const app = express() const port = 3000 app.listen(port,() => { console.log(`Listening

When I run this code:

const mysql = require('mysql2');

const express = require('express');

const app = express()

const port = 3000

app.listen(port,() => {

console.log(`Listening on http://localhost:${port}...`);

I get this error :

a.m.@Maxwells-MacBook-Pro-2 sql % node .\app.js node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module '/Users/a.m./Desktop/sql/.app.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []

why?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!