Refusing to install sqlite3 as a dependency of itself

Viewed 33006

I have the most recent version of node.js built with no problems. I am trying to use a sqlite module for node.js.

For node-sqlite3 by developmentseed, I followed the directions:

git clone git://github.com/developmentseed/node-sqlite3.git
cd node-sqlite3
./configure
make

I installed npm with: curl -k https://npmjs.org/install.sh | sudo sh

and installed node-gyp with npm: sudo npm install -g node-gyp

After node-sqlite3 configure-d and make-d okay, I tried to install with npm, I get this:

npm install sqlite3
npm WARN install Refusing to install sqlite3 as a dependency of itself

When I researched this error, I found this question: npm install sqlite3 error so I tried:

 node-waf clean || true; node-waf configure build

but got this error:

/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

When I tried to build orlandov/node-sqlite, I got it from git and then tried:

node-waf configure build

but I get this error:

/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'

I cannot use grumdrig/node-sqlite because it does not support asynchronous access.

Thank you for any suggestions.

6 Answers

Check if your project folder name is same as the module you are trying to install,

If you try to install express inside a project folder name express, you will get this error.

Rename your Project Folder, Your project Folder name should be unique compared to the npm module names

Also change the package.json file entry

 "name": "xxxxx",
  "version": "1.0.0",
Related