Answered step by step
Verified Expert Solution
Link Copied!

Question

...
1 Approved Answer

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

9781119563099

Students also viewed these Programming questions

Question

What reasons may there be for a conglomerate discount existing?

Answered: 1 week ago