Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
The requested module '/weatherapp/node_modules/mysql/index.js' does not provide an export named 'default

I'm making a weather app that implements an SQL database conection. I send the queries using the mysql npm module, I can't use require because node returns me

require is not defined in ES module scope

So i just import the module as here:

import mysql from 'mysql';

And it works fine in nodemon, but when I try to implement the whole app using xampp local server I get this error:

The requested module '/weatherapp/node_modules/mysql/index.js' does not provide an export named 'default

I've already tried using required in all the posible implementations (Using define, the [mysql], funtion() sintax ...) and it won't work.

I'm using a dbGestion.js file in which I try to import the mysql module and then defining functions and exporting them to main.js, where all the code for the app is.

You can checkout everything i have here: Proyect

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!