2013-09-06 2 views
4

Пожалуйста, соблюдайте:Невозможно установить Узел Postgres Node.js модуль

c:\Work\if\server>npm install pg 
npm WARN package.json [email protected] No README data 
npm WARN package.json [email protected] No README data 
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/2.0.3 
npm http GET https://registry.npmjs.org/buffer-writer/1.0.0 
npm http 304 https://registry.npmjs.org/generic-pool/2.0.3 
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0 
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 

> [email protected] install c:\Work\if\server\node_modules\pg 
> node-gyp rebuild || (exit 0) 


c:\Work\if\server\node_modules\pg>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\nod 
e-gyp.js" rebuild 
    binding.cc 
..\src\binding.cc(424): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) [c:\Work\if\server\node_module 
s\pg\build\binding.vcxproj] 
C:\Users\markk.IL-Mark-LT\.node-gyp\0.10.17\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> 
v8::Persistent<T>::New(v8::Handle<T>)' [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
      with 
      [ 
       T=v8::Object 
      ] 
    Creating library c:\Work\if\server\node_modules\pg\build\Release\binding.lib and object c:\Work\if\server\node_modules\pg\build\Releas 
    e\binding.exp 
binding.obj : error LNK2001: unresolved external symbol _PQfreemem [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQflush [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQresultErrorField [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsendQueryParams [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQgetCancel [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQclear [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsocket [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsendQueryPrepared [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQstatus [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQnotifies [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQisnonblocking [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQgetResult [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQputCopyEnd [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQcmdStatus [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsetnonblocking [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQescapeIdentifier [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQfinish [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQisBusy [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQerrorMessage [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQfname [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQntuples [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsendPrepare [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQgetCopyData [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQresultStatus [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsetNoticeProcessor [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQescapeLiteral [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQconnectStart [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQcancel [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQputCopyData [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQfreeCancel [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQgetvalue [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQsendQuery [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQconnectPoll [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQcmdTuples [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQresStatus [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQftype [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQconsumeInput [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQnfields [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
binding.obj : error LNK2001: unresolved external symbol _PQgetisnull [c:\Work\if\server\node_modules\pg\build\binding.vcxproj] 
c:\Work\if\server\node_modules\pg\build\Release\binding.node : fatal error LNK1120: 39 unresolved externals [c:\Work\if\server\node_modules 
\pg\build\binding.vcxproj] 
gyp ERR! build error 
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23) 
gyp ERR! stack  at ChildProcess.EventEmitter.emit (events.js:98:17) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (child_process.js:789:12) 
gyp ERR! System Windows_NT 6.1.7601 
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd c:\Work\if\server\node_modules\pg 
gyp ERR! node -v v0.10.17 
gyp ERR! node-gyp -v v0.10.9 
gyp ERR! not ok 
[email protected] node_modules\pg 
├── [email protected] 
└── [email protected] ([email protected], [email protected]) 

c:\Work\if\server>path 
PATH=c:\windows\system32;c:\windows;C:\Program Files (x86)\Graphviz2.30\bin;C:\Program Files\Calibre2\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\nodejs\;C:\Utils;c:\mongo\bin;c:\Program Files\TortoiseHg\;d:\PostgreSQL\9.2\bin\;c:\Python27\;d:\PostgreSQL\9.2\lib 

c:\Work\if\server> 

Видимо, проблема в том, что libpq.lib не связаны между собой и, таким образом, есть пропавшие ссылки на этапе сборки сцепления.

Но я не понимаю, почему проблема существует.

Я бежал Gyp непосредственно с целью конфигурирования:

c:\Work\if\server>cd node_modules\pg 

c:\Work\if\server\node_modules\pg>node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" configure 
gyp info it worked if it ends with ok 
gyp info using [email protected] 
gyp info using [email protected] | win32 | ia32 
gyp info spawn python 
gyp info spawn args [ 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp', 
gyp info spawn args 'binding.gyp', 
gyp info spawn args '-f', 
gyp info spawn args 'msvs', 
gyp info spawn args '-G', 
gyp info spawn args 'msvs_version=auto', 
gyp info spawn args '-I', 
gyp info spawn args 'c:\\Work\\if\\server\\node_modules\\pg\\build\\config.gypi', 
gyp info spawn args '-I', 
gyp info spawn args 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi', 
gyp info spawn args '-I', 
gyp info spawn args 'C:\\Users\\markk.IL-Mark-LT\\.node-gyp\\0.10.17\\common.gypi', 
gyp info spawn args '-Dlibrary=shared_library', 
gyp info spawn args '-Dvisibility=default', 
gyp info spawn args '-Dnode_root_dir=C:\\Users\\markk.IL-Mark-LT\\.node-gyp\\0.10.17', 
gyp info spawn args '-Dmodule_root_dir=c:\\Work\\if\\server\\node_modules\\pg', 
gyp info spawn args '--depth=.', 
gyp info spawn args '--generator-output', 
gyp info spawn args 'c:\\Work\\if\\server\\node_modules\\pg\\build', 
gyp info spawn args '-Goutput_dir=.' ] 
gyp info ok 

c:\Work\if\server\node_modules\pg> 

Я не знаю, если я должен увидеть его там, но нет ссылки на Postgres на всех в этом выводе.

Вот файл binding.gyp (моя ОС Windows 7):

{ 
    'targets': [ 
    { 
     'target_name': 'binding', 
     'conditions' : [ 
     ['OS=="win"', { 
      'conditions' : [ 
      ['"<[email protected](cmd /C where /Q pg_config || echo n)"!="n"', 
       { 
       'sources': ['src/binding.cc'], 
       'include_dirs': ['<[email protected](pg_config --includedir)'], 
       'libraries' : ['libpq.lib'], 
       'msvs_settings': { 
        'VCLinkerTool' : { 
        'AdditionalLibraryDirectories' : [ 
         '<[email protected](pg_config --libdir)\\' 
        ] 
        }, 
       } 
       } 
      ] 
      ] 
     }, { # OS!="win" 
      'conditions' : [ 
      ['"y"!="n"', # ToDo: add pg_config existance condition that works on linux 
       { 
       'sources': ['src/binding.cc'], 
       'include_dirs': ['<[email protected](pg_config --includedir)'], 
       'libraries' : ['-lpq -L<[email protected](pg_config --libdir)'] 
       } 
      ] 
      ] 
     }] 
     ] 
    } 
    ] 
} 

Конфигурация должна быть успешной, потому что:

c:\Work\if\server\node_modules\pg>cmd /C where /Q pg_config || echo n 

c:\Work\if\server\node_modules\pg>pg_config --includedir 
d:/POSTGR~1/9.2/include 

c:\Work\if\server\node_modules\pg>pg_config --libdir 
d:/POSTGR~1/9.2/lib 

c:\Work\if\server\node_modules\pg> 

еще что-то не так.

Как устранить эту проблему?

ответ

4

Глупо меня. My node.js - 32 бита, тогда как postgres - 64 бита. C'est tout!

+0

О, вы спасли меня, что дополнительные 20 минут отладки устанавливаются ... 'gyp' намного сложнее на' x64', чем 'x32', что я решил придерживаться узла' x32', но уже установил 'x64' Postgres. Цифры! –