Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with the installation of the module "pg" in centos #124

Closed
fox-alvarez opened this issue May 3, 2012 · 7 comments
Closed

problems with the installation of the module "pg" in centos #124

fox-alvarez opened this issue May 3, 2012 · 7 comments

Comments

@fox-alvarez
Copy link

good day
I'm trying to deploy an application to node.js socket.io and postgres.

I managed to make a single development locally (OS windows 7).
Now I tried running the project in a vps with centos 6, but I have not had success in installing the module "pg"

basically the problem is to run in terminal:

[root@kfees node-v0.6.8]# npm install pg

out:

npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 200 https://registry.npmjs.org/generic-pool/1.0.9
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9.tgz
npm http 200 https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9.tgz

> pg@0.6.17 install /node-v0.6.8/node_modules/pg
> node-waf configure build || (exit 0)

Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /usr/local
Checking for program pg_config           : not found
/node-v0.6.8/node_modules/pg/wscript:16: error: The program ['pg_config'] is required
pg@0.6.17 ./node_modules/pg
âââ generic-pool@1.0.9
[root@kfees node-v0.6.8]#

shows me 2 errors:
1.no no node path
2. can not find pg_config

in some forums I found that simply add

apt-get install libpq-dev

but this only works in Ubuntu and try to do the CentOS equivalent is:

yum install postgresql-devel

I would be very grateful for the solutions or corrections.
regards

@booo
Copy link
Contributor

booo commented May 3, 2012

Have you installed the postgresql-devel package? Maybe you need another package? Which packages did you install?

Debian/Ubuntu provides a tool to search for files in packages (apt-file). Maybe there is something similar in CentOS?

@fox-alvarez
Copy link
Author

thanks for replying booo

I run:

[root@kfees ~]# rpm -qa|grep postgresql

with this, the system tells me to install packages to postgres
and output was as follows:

[root@kfees ~]# rpm -qa|grep postgresql
postgresql91-libs-9.1.3-1PGDG.rhel6.x86_64
postgresql91-server-9.1.3-1PGDG.rhel6.x86_64
postgresql91-9.1.3-1PGDG.rhel6.x86_64
postgresql91-contrib-9.1.3-1PGDG.rhel6.x86_64
postgresql91-devel-9.1.3-1PGDG.rhel6.x86_64
[root@kfees ~]# 

that may be missing

thanks again for any help you can provide me

@booo
Copy link
Contributor

booo commented May 4, 2012

Maybe this is helpful http://serverfault.com/questions/316703/how-to-install-libpq-dev-on-centos-5-5

The ubuntu package for pg_config is libpq-dev...

@fox-alvarez
Copy link
Author

This puts me in the same situation from the beginning

I checked that I have these packages installed on the system

[root@kfees ~]# yum install postgresql-devel
...
Package postgresql91-devel-9.1.3-1PGDG.rhel6.x86_64 already installed and latest version
Nothing to do


[root@kfees ~]# yum install libpqxx-devel
...
Package 1:libpqxx-devel-4.0-0.1.rhel6.x86_64 already installed and latest version
Nothing to do

I have restarted postgres in case, but still shows the same result

[root@kfees node-v0.6.8]# npm install pg
npm http GET https://registry.npmjs.org/pg
npm http 304 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 304 https://registry.npmjs.org/generic-pool/1.0.9

> pg@0.6.17 install /node-v0.6.8/node_modules/pg
> node-waf configure build || (exit 0)

Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /usr/local
Checking for program pg_config           : not found
/node-v0.6.8/node_modules/pg/wscript:16: error: The program ['pg_config'] is required
pg@0.6.17 ./node_modules/pg
âââ generic-pool@1.0.9

I searched the location of the file 'pg_config'

[root@kfees /]# find -name "pg_config"
./usr/pgsql-9.1/bin/pg_config

it's worth

not to do now

thanks for the help

@booo
Copy link
Contributor

booo commented May 5, 2012

What if you try:

PG_CONFIG=./usr/pgsql-9.1/bin/pg_config npm install pg

@fox-alvarez
Copy link
Author

thank you very much booo's just what I needed.
the problem of reference to 'pg_config' was solved.

exactly as follows in case someone more interested

[root@kfees ~]# PG_CONFIG=/usr/pgsql-9.1/bin/pg_config
[root@kfees ~]# export PG_CONFIG
[root@kfees ~]# npm install pg

I have only now the error

Checking for node path                   : not found

will investigate a bit to solve and share the solution

greetings and thanks :)

@booo
Copy link
Contributor

booo commented May 5, 2012

not found is normal for the node path. Don't care.

Maybe close the ticket if you think everything is fine now.

Best Regards
Philipp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants