node-libpq icon indicating copy to clipboard operation
node-libpq copied to clipboard

Error finding libs on windows

Open miraries opened this issue 6 years ago • 2 comments

The following error comes up when installing:

e:\user\project\test\node-pg-native\node_modules\libpq\src\addon.h(5): fatal error C1083: Cannot open include file: 'libpq-fe.h': No such file or directory (compiling source file ..\src\connection.cc) [E:\user\project\test\node-pg-native\node_modules\libpq\build\addon.vcxproj]

After reading the input format reference for gyp I fixed it by changing the include_dirs in bindings from <!@(<(pgconfig) --includedir) to <!(<(pgconfig) --includedir)

I'm not sure if this should be changed, can there be multiple include directories for postgres? Anyway, with the former the compiler command has: /IE:\Program /I..\Files\PostgreSQL\10\include and with the change: /I"E:\Program Files\PostgreSQL\10\include"

Just posting if someone runs into this. Took me some time to get familiar with gyp but the main takeway, as it seems to be with other projects: no spaces in paths

miraries avatar Feb 22 '19 18:02 miraries

Hey! Still having an error, despite having everything inside env/path variables. Can successfully access pg_config, but when trying to install libpq package, getting this error:

...
Cannot open include file: 'libpq-fe.h'
...

Can you guys help me with identifying the (probably) real issue here?

yeskiy avatar Jun 05 '25 21:06 yeskiy

Hey! Still having an error, despite having everything inside env/path variables. Can successfully access pg_config, but when trying to install libpq package, getting this error:

...
Cannot open include file: 'libpq-fe.h'
...

Can you guys help me with identifying the (probably) real issue here?

Are you trying to install through npm? Try to build from the repository.

KingDanx avatar Jun 24 '25 14:06 KingDanx