gpt4 book ai didi

node.js - 无法让 mongojs(node-mongodb-native 包装器)在 Ubuntu 10.10 上工作

转载 作者:太空宇宙 更新时间:2023-11-04 01:16:40 25 4
gpt4 key购买 nike

我使用npm install mongojs来获取包装器,但是当尝试运行时我的应用程序出现以下错误:

node.js:195 
throw e; // process.nextTick error, or 'error' event on first tick
^
Native bson parser not compiled, please compile or avoid using native_parser=true

然后我尝试从github获取源代码并编译node-mongodb-我自己是本地人。然后运行 ​​make 时出现以下错误:

make -C ./external-libs/bson  
make[1]: Entering directory`/tmp/node-mongodb-native/external-libs/bson`
rm -rf build.lock-wscript bson.node node-waf configure build
Checking for program g++ or c++: /usr/bin/g++
Checking for program cpp: /usr/bin/cpp
Checking for program ar: /usr/bin/ar
Checking for program ranlib: /usr/bin/ranlib
Checking for g++: ok
Checking for node path: not found
Checking for node prefix: ok
/usr/local 'configure' finished successfully (0.069s)

Waf: Entering directory `/tmp/node-mongodb-native/external-libs/bson/build'
[1/9] cxx: bson.cc -> build/default/bson_1.o
[2/9] cxx: long.cc -> build/default/long_1.o
[3/9] cxx: objectid.cc -> build/default/objectid_1.o
[4/9] cxx: binary.cc -> build/default/binary_1.o
[5/9] cxx: code.cc -> build/default/code_1.o
[6/9] cxx: dbref.cc -> build/default/dbref_1.o
../bson.cc:7:25: fatal error: node_events.h: No such file or directory
compilation terminated.
../objectid.cc:6:25: fatal error: node_events.h: No such file or directory
compilation terminated.
../code.cc:6:25: fatal error: node_events.h: No such file or directory
compilation terminated.
../dbref.cc:6:25: fatal error: node_events.h: No such file or directory
compilation terminated.
../long.cc:6:25: fatal error: node_events.h: No such file or directory
compilation terminated.
../binary.cc:7:25: fatal error: node_events.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/tmp/node-mongodb-native/external-libs/bson/build'
Build failed: -> task failed (err #1):
{task: cxx objectid.cc -> objectid_1.o} -> task failed (err#1):
{task: cxx bson.cc -> bson_1.o} -> task failed (err #1):
{task: cxx code.cc -> code_1.o} -> task failed (err #1):
{task: cxx dbref.cc -> dbref_1.o} -> task failed (err #1):
{task: cxx long.cc -> long_1.o} -> task failed (err #1):
{task: cxx binary.cc -> binary_1.o} make[1]: *** [all] Error 1
make[1]: Leaving directory `/tmp/node-mongodb-native/external-libs/bson'
make: *** [build_native] Error 2

对于为什么会失败以及如何让它发挥作用有什么想法吗?

最佳答案

在问题修复之前,您必须使用 Node 0.5.1(您可以使用 gitk 将树恢复到此版本)

Auteur: Ryan Dahl <ry@tinyclouds.org>  2011-07-19 10:46:38
Auteur du commit: Ryan Dahl <ry@tinyclouds.org> 2011-07-19 10:46:38
Parent: 0a3fc1d9c8becc32c63ae736ca2b3719a3d03c5b (Remove StatWatcher's dep on C++ EventEmitter)
Enfant: 061ce7b0ac370c8a5ae93d95ab7da171cbd488f0 (net_uv: Fix simple/test-http-expect-continue.js)
Branche: master, remotes/origin/master
Suit: v0.5.1
Précède: v0.5.2
Finally remove node::EventEmitter

关于node.js - 无法让 mongojs(node-mongodb-native 包装器)在 Ubuntu 10.10 上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6864247/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com