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

275
Views
Al ver el error Módulo no encontrado: 'pg-native' en la aplicación heroku

Estoy intentando usar el complemento postgres con una aplicación de nodo heroku que también usa react.

Estoy usando este paquete de compilación de reacción para admitir reaccionar dentro de heroku: https://github.com/opike/create-react-app-buildpack.git

Cuando trato de agregar la línea:

 var pg = require('pg');

Recibo el siguiente error de compilación cuando intento ejecutar la aplicación heroku localmente:

 >heroku local web [OKAY] Loaded ENV .env File as KEY=VALUE Format [WARN] ENOENT: no such file or directory, open 'Procfile' [OKAY] package.json file found - trying 'npm start' 4:15:19 PM web.1 | > test-app@0.1.0 start /Users/oliverpike/dev/heroku/ofp-react 4:15:19 PM web.1 | > react-scripts start 4:15:20 PM web.1 | Starting the development server... 4:15:29 PM web.1 | Failed to compile. 4:15:29 PM web.1 | Error in ./~/pg/lib/native/index.js 4:15:29 PM web.1 | Module not found: 'pg-native' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/pg/lib/native 4:15:29 PM web.1 | @ ./~/pg/lib/native/index.js 1:13-33 4:15:29 PM web.1 | Error in ./~/pg/lib/connection-parameters.js 4:15:29 PM web.1 | Module not found: 'dns' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/pg/lib 4:15:29 PM web.1 | @ ./~/pg/lib/connection-parameters.js 2:10-24
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Pude superar este problema haciendo un:

 > npm i pg-native

como se describe aquí: https://github.com/brianc/node-pg-native

así como un

 > npm i dns

para el problema de dns.

Lo extraño fue que no necesitaba instalar explícitamente estos paquetes en mi otra aplicación heroku que usa postgres.

over 4 years ago · Santiago Trujillo Report
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!