pg db查询中的节点断言失败

时间:2013-07-15 02:23:09

标签: javascript node.js npm libuv

在Windows 7上的nodejs(0.10.13)上使用any-db(0.0.6)和pg(2.1.0)运行查询。使用npm的所有安装似乎都没问题。可以设置连接池,但失败并出现低级别错误:

// Runs OK
var anyDB = require('any-db');
var pool = anyDB.createPool(dbUrl, {min: 2, max: 10})
// Fails here... Content of sql doesn't seem to matter.
var q = pool.query(sql);

抛出: 断言失败:0,文件c:\ node-v0.10.13-x64 \ deps \ uv \ src \ win \ req-inl.h,第219行

(不能用try / catch&此目录甚至不存在......)

尝试了节点版本:0.10.12和0.10.13

我在安装pg时遇到了一些麻烦,但似乎没问题,这是安装消息:

C:\ETL-Devel>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/ref/0.1.3
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/ref/0.1.3
npm http GET https://registry.npmjs.org/ref/-/ref-0.1.3.tgz
npm http 304 https://registry.npmjs.org/generic-pool/2.0.3
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-2.0.3.tgz
npm http 304 https://registry.npmjs.org/buffer-writer/1.0.0
npm http 200 https://registry.npmjs.org/ref/-/ref-0.1.3.tgz
npm http 200 https://registry.npmjs.org/generic-pool/-/generic-pool-2.0.3.tgz
npm http GET https://registry.npmjs.org/cloned/0.0.1
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/cloned/0.0.1
npm http GET https://registry.npmjs.org/rmdir
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/debug

> ref@0.1.3 install C:\ETL-Devel\node_modules\pg\node_modules\ref
> node-gyp rebuild


C:\ETL-Devel\node_modules\pg\node_modules\ref>node "C:\Program Files\nodejs\node
_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebu
ild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
npm http 304 https://registry.npmjs.org/rmdir
  binding.cc
C:\Users\User\.node-gyp\0.10.13\deps\v8\include\v8.h(184): warning C4506: no de
finition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\ETL-Devel\node_modules\pg\node_modules\ref\build\binding.vcxproj]
          with
          [
              T=v8::Object
          ]
     Creating library C:\ETL-Devel\node_modules\pg\node_modules\ref\build\Relea
  se\binding.lib and object C:\ETL-Devel\node_modules\pg\node_modules\ref\build
  \Release\binding.exp
  Generating code
  Finished generating code
  binding.vcxproj -> C:\ETL-Devel\node_modules\pg\node_modules\ref\build\Releas
  e\\binding.node

> pg@2.1.0 install C:\ETL-Devel\node_modules\pg
> node-gyp rebuild || (exit 0)


C:\ETL-Devel\node_modules\pg>node "C:\Program Files\nodejs\node_modules\npm\bin\
node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  binding.cc
..\src\binding.cc(348): warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning) [C:\ETL-Devel\node_modules\pg\build\binding.vcxpr
oj]
..\src\binding.cc(849): warning C4267: 'argument' : conversion from 'size_t' to
 'int', possible loss of data [C:\ETL-Devel\node_modules\pg\build\binding.vcxpr
oj]
C:\Users\User\.node-gyp\0.10.13\deps\v8\include\v8.h(218): warning C4506: no de
finition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Hand
le<T>)' [C:\ETL-Devel\node_modules\pg\build\binding.vcxproj]
          with
          [
              T=v8::Object
          ]
     Creating library C:\ETL-Devel\node_modules\pg\build\Release\binding.lib an
  d object C:\ETL-Devel\node_modules\pg\build\Release\binding.exp
  Generating code
  Finished generating code
  binding.vcxproj -> C:\ETL-Devel\node_modules\pg\build\Release\\binding.node
pg@2.1.0 node_modules\pg
├── generic-pool@2.0.3
├── buffer-writer@1.0.0 (cloned@0.0.1)
└── ref@0.1.3 (bindings@1.1.1, debug@0.7.2)

非常感谢任何想法或帮助!


更新1

重新启动计算机后,错误消息已更改为以下内容: 断言失败:0,文件src \ win \ poll.c,第87行

这似乎是指:https://github.com/joyent/libuv/blob/master/src/win/poll.c

我也间歇地得到了另一个错误。

尝试了v0.10.10 ..现在只是得到第一个错误。

更新2

我尝试使用节点v0.10.13-x86(而不是x64)。我的代码似乎在重新安装pg后正常运行,但在重新安装pg时会抛出错误(使用npm):

... Creating library C:\ETL-Devel\node_modules\pg\build\Release\binding.lib an
d object C:\ETL-Devel\node_modules\pg\build\Release\binding.exp
binding.obj : error LNK2001: unresolved external symbol _PQfreemem [C:\ETL-Deve
l\node_modules\pg\build\binding.vcxproj]
binding.obj : error LNK2001: unresolved external symbol _PQflush [C:\ETL-Devel\
node_modules\pg\build\binding.vcxproj]

... [34 statements removed]

binding.obj : error LNK2001: unresolved external symbol _PQgetisnull [C:\ETL-De
vel\node_modules\pg\build\binding.vcxproj]
C:\ETL-Devel\node_modules\pg\build\Release\binding.node : fatal error LNK1120:
37 unresolved externals [C:\ETL-Devel\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_mo
dules\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\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\ETL-Devel\node_modules\pg
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok
pg@2.1.0 node_modules\pg
├── generic-pool@2.0.3
├── buffer-writer@1.0.0 (cloned@0.0.1)
└── ref@0.1.3 (bindings@1.1.1, debug@0.7.2)

0 个答案:

没有答案