我有最新版本的 node.js,没有任何问题。我正在尝试为 node.js 使用 sqlite 模块。
对于 developmentseed 的 node-sqlite3,我按照以下说明进行操作:
git clone git://github.com/developmentseed/node-sqlite3.git
cd node-sqlite3
./configure
make
我安装了 npm: curl -k https://npmjs.org/install.sh | 须藤
并使用 npm 安装 node-gyp: sudo npm install -g node-gyp
在 node-sqlite3 configure-d 和 make-d 好之后,我尝试用 npm 安装,我得到了这个:
npm install sqlite3
npm WARN install Refusing to install sqlite3 as a dependency of itself
当我研究这个错误时,我发现了这个问题:npm install sqlite3 error所以我尝试了:
node-waf clean || true; node-waf configure build
但收到此错误:
/usr/local/bin/../lib/node/wafadmin/Utils.py:136: DeprecationWarning: the md5 module is deprecated; use hashlib instead
from md5 import md5
Waf: Please run waf from a directory containing a file named "wscript" or run distclean
/usr/local/bin/../lib/node/wafadmin/Utils.py:136: DeprecationWarning: the md5 module is deprecated; use hashlib instead
from md5 import md5
arg[0] directory does not contain a wscript file
当我尝试构建 orlandov/node-sqlite 时,我从 git 得到它,然后尝试:
node-waf configure build
但我收到此错误:
/usr/local/bin/../lib/node/wafadmin/Utils.py:136: DeprecationWarning: the md5 module is
deprecated; use hashlib instead
from md5 import md5
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /nnmc/cvsbin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : cc
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.070s)
Waf: Entering directory `/U1/dorothyy/project_node/node-sqlite/build'
/U1/dorothyy/project_node/node-sqlite/deps/mpool-2.1.0
make: Nothing to be done for `all'.
Waf: Leaving directory `/U1/dorothyy/project_node/node-sqlite/build'
Traceback (most recent call last):
File "/usr/local/bin/node-waf", line 16, in <module>
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 255, in compile
self.flush()
File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 717, in flush
tg.post()
File "/usr/local/bin/../lib/node/wafadmin/TaskGen.py", line 219, in post
self.apply()
File "/usr/local/bin/../lib/node/wafadmin/TaskGen.py", line 206, in apply
v()
File "/usr/local/bin/../lib/node/wafadmin/TaskGen.py", line 464, in apply_core
node = find_resource(filename)
File "/usr/local/bin/../lib/node/wafadmin/Node.py", line 183, in find_resource
st = Utils.h_file(path)
AttributeError: 'module' object has no attribute 'h_file'
我不能使用 grumdrig/node-sqlite,因为它不支持异步访问。
感谢您的任何建议。