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

293
Views
SyntaxError: final inesperado de la entrada JSON. en JSON.parse (<anónimo>)

Soy un nuevo desarrollador que está aprendiendo a trabajar con API y me he encontrado con este error varias veces que sigue bloqueando Node:

SyntaxError: final inesperado de la entrada JSON en JSON.parse () en IncomingMessage. (/Usuarios/dharmendrasingh/Desktop/WeatherProject/app.js:13:28)

No estoy muy seguro de cómo resolverlo o cuál es exactamente el problema... mi código JS se ve así:

 const express = require("express"); const https = require("https"); const app = express(); app.get("/", function(req, res){ const url = "https://postman-echo.com/get?q=London&appid=639179c2c6d4f4db9c4657a69ac05438&units=matric"; https.get(url, function(response){ console.log(response.statusCode); response.on("data", function(data){ const weather = JSON.parse(data); console.log(weather); }); }) res.send("Server is up and running"); }) app.listen(3000, function(req, res){ console.log("Server is running at port: 3000."); });
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!