0

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!

4

1 回答 1

2

我正在关注 Heroku 的“Node.js 入门”文章,该文章建议使用 pg 包的 v0.5.4。

但是,我使用的是 Node 的 0.6.x 版本,所以我遇到了同样的错误。

我通过更改我的 package.json 文件以指定 pg 的 v 0.6.15 来修复它。

"dependencies": { "pg": "0.6.15" }

于 2012-04-11T09:37:24.360 回答