Open devmetal opened 8 years ago
I have the same problem on Windows 10
the same problem windows 10
Same thing W10
I'm totaly desperate. The funny thing is, in our office, on windows7 with vs2015, its working perfectly (lot of warning but working). But in my personal laptop with windows 8.1, same vs2015, its always got a same error with the headers:
c:\users\�d�m\appdata\roaming\npm\node_modules\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\addon.cc) [C:\Users\�d�m\AppData\Roaming\npm\node_modules\pg-native\node_modules\libpq\build\addon.vcxproj] c:\users\�d�m\appdata\roaming\npm\node_modules\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\connect-async-worker.cc) [C:\Users\�d�m\AppData\Roaming\npm\node_modules\pg-native\node_modules\libpq\build\addon.vcxproj] c:\users\�d�m\appdata\roaming\npm\node_modules\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) [C:\Users\�d�m\AppData\Roaming\npm\node_modules\pg-native\node_modules\libpq\build\addon.vcxproj]
I reinstalled my node, npm, visualstudio, postgresql everything in 64 bit, twice.
Next weekend i try reinstall my windows.
Really @devmetal you're going to take it all the way too reinstalling windows? God bless ya
@alallier I don't know what can i do. Maybe we have to try install a specific version? The problem is, im not a low level programer.
@devmetal did you do this?
You need PostgreSQL client libraries & tools installed. An easy way to check is to type pg_config. If pg_config is in your path, you should be good to go. If it's not in your path you'll need to consult operating specific instructions on how to go about getting it there.
Some ways I've done it in the past:
On OS X: brew install postgres
On Ubuntu: apt-get install libpq-dev
On RHEL/CentOS: yum install postgresql-devel
On Windows:
Install Visual Studio C++ (successfully built with Express 2010). Express is free.
Install PostgreSQL (http://www.postgresql.org/download/windows/)
Add your Postgre Installation's bin folder to the system path (i.e. C:\Program Files\PostgreSQL\9.3\bin).
Make sure that both libpq.dll and pg_config.exe are in that folder.
@tintoverano Yes but not worked for me. But, i reinstalled my windows and now its working for me.
@tintoverano It seems that requires libpq.lib and not libpq.dll, is it possible?
Hi I get the following error when id do npm install pg-native --save. I am using Windows 7
C:\WS\pgnativetest\node_modules\pg-native\node_modules\libpq>if not defined npm
config_node_gyp (node "C:\Users\Alok\AppData\Roaming\npm\node_modules\npm\bin\n
de-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node
rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit node.lib
gyp ERR! stack at Request.
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:103:2 ) gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:359:20) gyp ERR! stack at emitOne (events.js:90:13) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Alok\AppDat \Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "r build" gyp ERR! cwd C:\WS\pgnativetest\node_modules\pg-native\node_modules\libpq gyp ERR! node -v v5.11.0 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Alok\AppData\ oaming\npm\node_modules\npm\bin\npm-cli.js" "install" "pg-native" "--save" npm ERR! node v5.11.0 npm ERR! npm v2.11.2 npm ERR! code ELIFECYCLE
npm ERR! libpq@1.8.5 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libpq@1.8.5 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libpq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls libpq
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! C:\WS\pgnativetest\npm-debug.log
Can you help? Thanks.
Hi, i suggest to try the latest npm version:
npm install npm@latest -g
If you get some errors, or npm not installed, try this: https://www.npmjs.com/package/npm-windows-upgrade
@devmetal Thank you very much for responding. I will try it (maybe) because i have many apps that are working on the current version of npm and fixing this app may break them. In any case thanks a lot for your response.
@tintoverano @devmetal Thanks! I had this issue on a Linux machine and install libpq-dev fixed the problem for me. :+1: :clap:
Hi all,
We had the same issue in Windows 10. So the thing that we observed was the path C:\Program Files\PostgreSQL\9.6\bin
should be moved up in the Path
variable. So that cygwin and other tools path should come later. If this is done right, thelibpq-fq.h
will be resolved while building pg related modules.
I have the same issue, but I have PostgreSQL 10 installed. There is no libpg-fq.h file at all under the includes dir. I guess it won't compile with version 10. Do I have to install 9.6 just to install it against an older version if libpq?
I also had PostgreSQL installed to D:\Program Files\PostgreSQL. Both \bin and \include were added to path too. But it would still fail with: C1083: Cannot open include file: 'libpq-fe.h
The only fix that worked for me (Windows 10) was to uninstall PostgreSQL, then install to C: Then I added: C:\Program Files\PostgreSQL\10\bin C:\Program Files\PostgreSQL\10\include
To path: from explorer, right click This PC, Advanced system settings, Environment Variables, under system variables --> highlight "Path", Edit.., New, then OK.
Open up a new Git Bash or Powershell screen (it won't pick up a change in the PATH unless you do)
Now I can install pg-native without issue.
@rjkunde Yes yes. Currently i don't use this package, it cool, not because its bad or something, i was satisfied with this, currenty we are not using postgre. Anyway i remember the solution was the same, i had to install the postgre to C: drive, above windows :)
@manju4ever thank so much
In Linux Mint apt install libpq-dev
solved the issue for me.
@remojansen -
Thank you. I tried everything under the sun - spent 4 hours looking for answers then this helped me.
apt install libpq-dev
On Windows, I had it added to my environment variables PATH for user variables, but it needed to be added in system variables
I needed postgresql-libs
on Arch
RHEL8 here - I fixed it by running dnf install redhat-rpm-config libpq-devel
Hi, i have an issue with this module install. I followed the manual, installed postgresql added to path and i checked the dll and config files.
I use windows 8.1, visual studio 2015 community with the latest npm and node version.
Here is the output of npm install pg-native -g --verbose > output.txt command:
Thank you :)