I am attempting to get the Postgesql client for node working with NPM. Using node v0.6.14 and receiving the following error:
pg@0.5.4 install /Users/matt/Sites/node_test/node_modules/pg
node-waf configure build || true
Checking for program g++ or c++ : /usr/bin/g++
...
'configure' finished successfully (0.082s)
Waf: Entering directory '/Users/matt/Sites/node_test/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/Release/src/binding_1.o
../src/binding.cc:3:25: error: node_events.h: No such file or directory
...
Build failed: -> task failed (err #1): {task: cxx binding.cc -> binding_1.o} pg@0.5.4 ./node_modules/pg └── generic-pool@1.0.6`
I have set the $NODE_PATH, and feel a bit stuck at this point, not quite knowing what is wrong. Thank you!
I was following the Heroku 'Getting Started with Node.js' article and that suggests using v0.5.4 of the pg package.
However, I am using version 0.6.x of Node and that so I was getting this same error you are.
I fixed it by changing my package.json file to specify v 0.6.15 of pg.
"dependencies": {
"pg": "0.6.15"
}