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

307
Views
Recibo un error cuando intento escribir el nodo js en electron
import React, { useEffect, useState } from 'react' import Navbar from './Navbar'; import Cards from './Cards'; const NewsAPI = require('newsapi'); const newsapi = new NewsAPI('apikey'); const Home = () => { const [news, setNews] = useState(); useEffect(() => { newsapi.v2.topHeadlines({ sources: 'bbc-news,the-verge', q: 'bitcoin', category: 'business', language: 'en', country: 'us' }).then((response: any) => { setNews(response.articles); console.log(response.articles); }); },[]) return ( <> <Navbar /> <div id='cards'> {/* code */} </div> </> ) } export default Home

Estoy usando el modelo de reacción de electrones. Cuando intento ejecutar este código, obtengo estos errores:

 Cannot GET /index.html
 ERROR in ./node_modules/electron/index.js 2:13-28 Module not found: Error: Can't resolve 'path' in '/Users/monke/Stream/frontend/stream-app/node_modules/electron' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./src/renderer/Home.tsx 36:17-36 @ ./src/renderer/index.tsx 12:31-48

Aunque si elimino el código del nodo js, el error desaparece. ¿No se supone que debo escribir el código del nodo js en el archivo del componente? Si no, ¿dónde se supone que debo escribirlo? Si lo escribo en otro lugar, ¿cómo se supone que debo enviar esa información al componente?

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!