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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started