brianc / node-pg-native

Native (C/C++) bindings to PostgreSQL with sync and async options.
247 stars 44 forks source link

fatal error: libpq-fe.h: No such file or directory #95

Closed LJNeon closed 4 years ago

LJNeon commented 4 years ago

When I attempt to install pg-native, I get the following error:

make: Entering directory '/home/user/project/node_modules/libpq/build'
  CXX(target) Release/obj.target/addon/src/connection.o
In file included from ../src/connection.cc:1:
../src/addon.h:5:10: fatal error: libpq-fe.h: No such file or directory
    5 | #include <libpq-fe.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [addon.target.mk:117: Release/obj.target/addon/src/connection.o] Error 1

I already have PostgreSQL installed, and I'm not sure what other problems would cause a missing header file.

LJNeon commented 4 years ago

Nevermind, sudo apt install libpq-dev solved the problem for me.