question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When trying to install, I see:

'pg_config' is not recognized as an internal or external command,
operable program or batch file.
gyp: Call to 'pg_config --includedir' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Path\to\project\node_modules\pg
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok

There is nothing added to the error when running NPM with --verbose. I have also tried clearing the NPM cache. According to Travis CI, it passes on Linux.


Windows 8 Pro 32-bit NodeJS 0.10.18 NPM 1.3.8

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DaAwesomePcommented, Jun 11, 2014

I just realized that I fixed it! I had both pg and pg.js installed at the same time. When I removed pg, Knex stopped working. That’s probably another bug that I’ll open later. It said that pgpass was missing.

To build node-postgres on Windows

  • Install Visual Studio C++ (tested with Express 2010)
  • Add the path to tour Postgres bin to the system path ENV (i.e. C:\Program Files\PostgreSQL\9.3\bin)
  • Make sure that both libpq.dll and pg_config.exe are in that folder.
  • npm install pg
0reactions
DaAwesomePcommented, Jun 11, 2014

knex should support pg AND pg.js (= node-postgres-pure), see here.

I guess so. That seems to work perfectly. However, since that is an alternative fix and not really helping the problem, I will keep this open. I think that this should be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Install Apps or Software on Windows? Here's What ...
Unable to Install Apps or Software on Windows? Here's What to Do · 1. Reboot Your Computer · 2. Check App Installer Settings...
Read more >
Can't Install Anything on Windows 10: 7 Easy Expert fixes
How do I fix Windows 10 if it can't install anything? · 1. Terminate the Windows Installer process · 2. Disable Fast Startup...
Read more >
Fix problems downloading apps from the Play Store
Try the steps below if: Your downloads and app updates get stuck and won't finish. You can't download or install apps or games...
Read more >
Cannot install software in Windows11 - Microsoft Community
1.It may be caused by Windows Installer not running effectively, please try the following steps: 1) Enter "services" in the search box and...
Read more >
Top 6 Ways to Fix Unable to Install Programs or Software on ...
Top 6 Ways to Fix Unable to Install Programs or Software on Windows 11 · 1. Check Program Compatibility · 2. Run Installer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found