gyp: Call to 'pg_config --libdir' returned exit status 127. while trying to load binding.gyp #223

Closed
groucho opened this Issue Mar 26, 2013 · 4 comments

Projects

None yet

4 participants

@groucho
groucho commented Mar 26, 2013

node-gyp rebuild || (exit 0)

/bin/sh: 1: pg_config: not found
gyp: Call to 'pg_config --libdir' returned exit status 127. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:416:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:754:12)
gyp ERR! System Linux 3.2.0-39-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/geddy/node_modules/model/node_modules/pg
gyp ERR! node -v v0.10.0
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok

encountered error while trying to install geddy on node v0.10.0

@wiii
wiii commented May 7, 2013

good day
Actualmete I have the same problem.
what was the solution to the problem groucho???

I have tried entering the module "/ root/nvm/v0.8.21/lib/node_modules/pg"
and run "configure node-gyp"

But still the output is as follows:

gyp info it worked if it ends with ok
gyp info using node-gyp@0.9.5
gyp info using node@0.8.21 | linux | x64
gyp info spawn python
gyp info spawn args [ '/root/nvm/v0.8.21/lib/node_modules/node-gyp/gyp/gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/root/nvm/v0.8.21/lib/node_modules/pg/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/nvm/v0.8.21/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/0.8.21/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/0.8.21',
gyp info spawn args   '-Dmodule_root_dir=/root/nvm/v0.8.21/lib/node_modules/pg',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
/bin/sh: pg_config: command not found
gyp: Call to 'pg_config --libdir' returned exit status 127. 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 (/root/nvm/v0.8.21/lib/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 2.6.32-042stab068.8
gyp ERR! command "node" "/root/nvm/v0.8.21/bin/node-gyp" "configure"
gyp ERR! cwd /root/nvm/v0.8.21/lib/node_modules/pg
gyp ERR! node -v v0.8.21
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok

I expect prompt response, thanks

@TooTallNate
Collaborator

It looks like you're missing a pg_config command in your PATH required by the module you're installing. Make sure you have all the deps for the particular module before installing!

@TooTallNate TooTallNate closed this May 7, 2013
@wiii
wiii commented May 7, 2013

Hello TooTallNate

run the following commands:

/root/nvm/v0.8.21/lib/node_modules#export PATH=$PATH:/usr/pgsql-9.1/bin
/root/nvm/v0.8.21/lib/node_modules#npm install -g pg

The output was:

npm WARN cannot run in wd pg@1.1.0 rm -r build || (exit 0) (wd=pg)
npm http GET https://registry.npmjs.org/generic-pool/2.0.2
npm http GET https://registry.npmjs.org/buffer-writer/1.0.0
npm http 304 https://registry.npmjs.org/generic-pool/2.0.2
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0
npm WARN package.json buffer-writer@1.0.0 No README.md file found!
npm http GET https://registry.npmjs.org/cloned/0.0.1
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/cloned/0.0.1
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/rmdir
npm http 304 https://registry.npmjs.org/rmdir

> pg@1.1.0 install /root/nvm/v0.8.21/lib/node_modules/pg
> node-gyp rebuild || (exit 0)

make: Entering directory `/root/nvm/v0.8.21/lib/node_modules/pg/build'
  CXX(target) Release/obj.target/binding/src/binding.o
  SOLINK_MODULE(target) Release/obj.target/binding.node
  SOLINK_MODULE(target) Release/obj.target/binding.node: Finished
  COPY Release/binding.node
make: Leaving directory `/root/nvm/v0.8.21/lib/node_modules/pg/build'
pg@1.1.0 /root/nvm/v0.8.21/lib/node_modules/pg
âââ generic-pool@2.0.2
âââ buffer-writer@1.0.0 (async@0.2.8, cloned@0.0.1)

Do not know if it was a clean install, or even no problems?

regards

@kdemarest

Sorry to be dense, but I see a lot of people confused by this. Can you please confirm that when I see this:

gyp: Call to 'pg_config --libdir' returned exit status 127. while trying to load binding.gyp

What is REALLY happening is that the people who made the module are using node-gyp to do their install, and it is THEIR problem. Not node-gyp's problem at all, right?

When it follows up with:

gyp ERR! stack Error: `gyp` failed with exit code: 1

I get this really negative impression of node-gyp because every time I have an npm install issue, the failure is clearly gyp's problem! You might put something in bold on the github readme way up top, for the idiots like me... Or perhaps change how errors are reported just a bit.

@stevelacy stevelacy referenced this issue in stevelacy/msi-keyboard-gui Dec 29, 2016
Closed

Problem during npm install #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment