title: Could not install pg module in node.js on Windows 7
body: <p>I try to install pg module to Node.js using this command: <code>npm install pg</code></p>
  
  <p>At first I had to install Python. Then PostgreSQL 8.x, then Microsoft Visual C++. But still it  I cannot do it. I have errors while compiling:</p>
  
  <pre><code>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
  
  &gt; pg@0.7.2 install C:\Users\Adam\node_modules\pg
  &gt; node-gyp rebuild || (exit 0)
  
  C:\Users\Adam\node_modules\pg&gt;node "C:\Program Files\nodejs\node_modules\npm\bin
  \node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
    binding.cc
  c:\users\adam\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'node:
  :ObjectWrap::handle_' : class 'v8::Persistent&lt;T&gt;' needs to have dll-interface t
  o be used by clients of class 'node::ObjectWrap' [C:\Users\Adam\node_modules\pg
  \build\binding.vcxproj]
            with
            [
                T=v8::Object
            ]
  ..\src\binding.cc(83): error C2061: syntax error : identifier 'EV_P_' [C:\Users
  \Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(237): error C2146: syntax error : missing ';' before identifi
  er 'read_watcher_' [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(237): error C4430: missing type specifier - int assumed. Note
  : C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
  .vcxproj]
  ..\src\binding.cc(237): error C4430: missing type specifier - int assumed. Note
  : C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
  .vcxproj]
  ..\src\binding.cc(238): error C2146: syntax error : missing ';' before identifi
  er 'write_watcher_' [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(238): error C4430: missing type specifier - int assumed. Note
  : C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
  .vcxproj]
  ..\src\binding.cc(238): error C4430: missing type specifier - int assumed. Note
  : C++ does not support default-int [C:\Users\Adam\node_modules\pg\build\binding
  .vcxproj]
  ..\src\binding.cc(86): error C2065: 'w' : undeclared identifier [C:\Users\Adam\
  node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(86): error C2227: left of '-&gt;data' must point to class/struct
  /union/generic type [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
            type is ''unknown-type''
  ..\src\binding.cc(87): error C2065: 'revents' : undeclared identifier [C:\Users
  \Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(117): warning C4800: 'int' : forcing value to bool 'true' or
  'false' (performance warning) [C:\Users\Adam\node_modules\pg\build\binding.vcxp
  roj]
  ..\src\binding.cc(247): error C2065: 'read_watcher_' : undeclared identifier [C
  :\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(247): error C3861: 'ev_init': identifier not found [C:\Users\
  Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(248): error C2065: 'read_watcher_' : undeclared identifier [C
  :\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(248): error C2228: left of '.data' must have class/struct/uni
  on [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
            type is ''unknown-type''
  ..\src\binding.cc(249): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(249): error C3861: 'ev_init': identifier not found [C:\Users\
  Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(250): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(250): error C2228: left of '.data' must have class/struct/uni
  on [C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
            type is ''unknown-type''
  ..\src\binding.cc(312): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
  Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(312): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(312): error C3861: 'ev_io_start': identifier not found [C:\Us
  ers\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(358): error C2065: 'read_watcher_' : undeclared identifier [C
  :\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(358): error C2065: 'EV_READ' : undeclared identifier [C:\User
  s\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(358): error C3861: 'ev_io_set': identifier not found [C:\User
  s\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(359): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(359): error C2065: 'EV_WRITE' : undeclared identifier [C:\Use
  rs\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(359): error C3861: 'ev_io_set': identifier not found [C:\User
  s\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(384): error C2065: 'EV_ERROR' : undeclared identifier [C:\Use
  rs\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(395): error C2065: 'EV_READ' : undeclared identifier [C:\User
  s\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(434): error C2065: 'EV_WRITE' : undeclared identifier [C:\Use
  rs\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(623): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
  Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(623): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(623): error C3861: 'ev_io_stop': identifier not found [C:\Use
  rs\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(629): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
  Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(629): error C2065: 'write_watcher_' : undeclared identifier [
  C:\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(629): error C3861: 'ev_io_start': identifier not found [C:\Us
  ers\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(635): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
  Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(635): error C2065: 'read_watcher_' : undeclared identifier [C
  :\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(635): error C3861: 'ev_io_stop': identifier not found [C:\Use
  rs\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(641): error C2065: 'EV_DEFAULT_' : undeclared identifier [C:\
  Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(641): error C2065: 'read_watcher_' : undeclared identifier [C
  :\Users\Adam\node_modules\pg\build\binding.vcxproj]
  ..\src\binding.cc(641): error C3861: 'ev_io_start': identifier not found [C:\Us
  ers\Adam\node_modules\pg\build\binding.vcxproj]
  gyp ERR! rebuild error Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msb
  uild.exe` failed with exit code: 1
  gyp ERR! rebuild error     at ChildProcess.onExit (C:\Program Files\nodejs\node_
  modules\npm\node_modules\node-gyp\lib\build.js:214:23)
  gyp ERR! rebuild error     at ChildProcess.EventEmitter.emit (events.js:91:17)
  gyp ERR! rebuild error     at Process._handle.onexit (child_process.js:674:10)
  gyp ERR! not ok
  pg@0.7.2 node_modules\pg
  └── generic-pool@1.0.9 
  </code></pre>
  
  <p>Any ideas? Without this module, I cannot connect to my PostgreSQL database through Node.js.</p>