nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.22k stars 3.88k forks source link

nw 0.7.5 and sqlite3 2.1.17 runtime error #1153

Closed xtweetyx closed 10 years ago

xtweetyx commented 10 years ago

I am unable to run sqlite3 rebuilt for node-webkit, even from a fresh install and build with a trivial application. nw crashes at var sqlite3 = require('sqlite3').

The complete output from the application is

[2369:0927/010837:INFO:gpu_info_collector_x11.cc(80)] NVCtrl extension does not exist.
/usr/local/pkg/node-webkit-v0.7.5-linux-x64/nw --type=renderer --enable-experimental-webkit-features --no-sandbox --lang=en-US --nodejs --working-directory=/home/xtweetyx/Projects/datatools/node-webkit/. --child-clean-exit --disable-accelerated-2d-canvas --disable-accelerated-video-decode --channel=2369.0.1131591271: symbol lookup error: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/lib/binding/Release/node-v11-linux-x64/node_sqlite3.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPFNS_6HandleINS_5ValueEEERKNS_9ArgumentsEES3_NS1_INS_9SignatureEEE

This runtime error appears to be similar to others reported when rebuilding sqlite3 incorrectly for node-webkit, that is, not in accordance with the instructions from node-webkit or instructions from sqlite3.

However, I have tried to follow the instructions correctly. I rebuilt sqlite3 as shown, starting from the application directory:

cd node_modules/sqlite3
nw-gyp rebuild --target=0.7.5

which generated the following output

gyp info it worked if it ends with ok
gyp info using nw-gyp@0.10.9
gyp info using node@0.10.18 | linux | x64
gyp info spawn python
gyp info spawn args [ '/usr/lib/node_modules/nw-gyp/gyp/gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/nw-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/xtweetyx/.nw-gyp/0.7.5/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/xtweetyx/.nw-gyp/0.7.5',
gyp info spawn args   '-Dmodule_root_dir=/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c: In function ‘porter_stemmer’:
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127208:41: warning: value computed is not used [-Wunused-value]
      stem(&z, "lanoita", "ate", m_gt_0) ||
                                         ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127212:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "icne", "ence", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127225:35: warning: value computed is not used [-Wunused-value]
      stem(&z, "ile", "e", m_gt_0) ||
                                   ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127230:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "noita", "ate", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127236:41: warning: value computed is not used [-Wunused-value]
      stem(&z, "ssenluf", "ful", m_gt_0) ||
                                         ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127241:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "itivi", "ive", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127250:36: warning: value computed is not used [-Wunused-value]
      stem(&z, "evita", "", m_gt_0)   ||
                                    ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127257:37: warning: value computed is not used [-Wunused-value]
      stem(&z, "laci", "ic", m_gt_0) ||
                                     ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127300:39: warning: value computed is not used [-Wunused-value]
          stem(&z, "tnem", "", m_gt_1) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127320:34: warning: value computed is not used [-Wunused-value]
      stem(&z, "eta", "", m_gt_1) ||
                                  ^
  AR(target) Release/obj.target/deps/sqlite3.a
  COPY Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/database.o
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/database.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/database.cc:2:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/database.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  CXX(target) Release/obj.target/node_sqlite3/src/node_sqlite3.o
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/node_sqlite3.cc:1:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/node_sqlite3.cc:1:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/node_sqlite3.cc:1:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  CXX(target) Release/obj.target/node_sqlite3/src/statement.o
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/statement.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/statement.cc:2:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/statement.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node: Finished
  COPY Release/node_sqlite3.node
make: Leaving directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
gyp info ok 

My system and software specifications: uname -a: 3.10.10-200.fc19.x86_64... node.js v0.10.18 node-webkit v0.7.5 sqlite3 v2.1.17 nw-gyp 0.10.9

The only other item of note is my install of node-webkit also required establishing a logical link from libudev.so.0 in the nw installation directory to /usr/lib64/libudev.so.1 and adjusting LD_LIBRARY_PATH accordingly, as mentioned here. This may not be relevant but I am trying to identify anything that could be a culprit.

Forgive me in advance if this is appropriate for nw-gyp or sqlite3 instead.

richardcypher commented 10 years ago

I can confirm it too on linux x64, maybe you can have a look at https://github.com/developmentseed/node-sqlite3/issues/196

xtweetyx commented 10 years ago

Yes, it does appear to be the same issue as mentioned in developmentseed/node-sqlite3#196.

As a workaround, node-webkit 0.7.5 works with 2.1.15 of sqlite3 in my configuration:

npm install sqlite3@2.1.15
cd node_modules/sqlite3
nw-gyp rebuild --target=0.7.5

For now I will revert to that version, thanks for the link getting me unstuck.

Mithgol commented 10 years ago

@springmeyer at developmentseed/node-sqlite3#196 recommends forcing a source compile.

Has anyone tried that yet?

xtweetyx commented 10 years ago

I forced a source compile of sqlite3 as suggested, but received the same error:

npm install sqlite3 --build-from-source

generated

npm WARN package.json datatools@0.1.0 No repository field.
npm http GET https://registry.npmjs.org/sqlite3
npm http 304 https://registry.npmjs.org/sqlite3
npm http GET https://registry.npmjs.org/progress
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/tar.gz
npm http 304 https://registry.npmjs.org/progress
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/tar.gz
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/inherits

> sqlite3@2.1.17 install /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3
> node build.js

make: Entering directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o
  AR(target) Release/obj.target/deps/sqlite3.a
  COPY Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/database.o
  CXX(target) Release/obj.target/node_sqlite3/src/node_sqlite3.o
  CXX(target) Release/obj.target/node_sqlite3/src/statement.o
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node: Finished
  COPY Release/node_sqlite3.node
make: Leaving directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
[sqlite3]: Created: lib/binding/Release/node-v11-linux-x64
[sqlite3]: Installed in lib/binding/Release/node-v11-linux-x64/node_sqlite3.node
[sqlite3]: Sweet: "node_sqlite3.node" is valid, node-sqlite3 is now installed!
sqlite3@2.1.17 node_modules/sqlite3
├── progress@1.0.1
├── mkdirp@0.3.5
└── tar.gz@0.1.1 (commander@1.1.1, tar@0.1.18, fstream@0.1.24)

Then I went into node_modules/sqlite3 and executed nw-gyp rebuild --target=0.7.5 as specified.

The identical error was generated at run-time:

/usr/local/pkg/node-webkit-v0.7.5-linux-x64/nw --type=renderer --enable-experimental-webkit-features --no-sandbox --lang=en-US --nodejs --working-directory=/home/xtweetyx/Projects/datatools/node-webkit/. --child-clean-exit --disable-accelerated-2d-canvas --disable-accelerated-video-decode --channel=21590.0.1199885381: symbol lookup error: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/lib/binding/Release/node-v11-linux-x64/node_sqlite3.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPFNS_6HandleINS_5ValueEEERKNS_9ArgumentsEES3_NS1_INS_9SignatureEEE

I can also confirm that installing sqlite3@2.1.16 does not work either. The most recent working version appears to be 2.1.15.

springmeyer commented 10 years ago

What is the fully output of nw-gyp rebuild --target=0.7.5 --verbose? Based on what you have shared above it is not clear that node-sqlite3 is actually being rebuilt with nw-gyp.

springmeyer commented 10 years ago

Also, does anything exist in /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/lib/binding/Debug/ ?

xtweetyx commented 10 years ago

@springmeyer thanks for helping.

The complete output of nw-gyp rebuild --target=0.7.5 --verbose after executing npm install sqlite3 --build-from-source with the current version 2.1.17 is

gyp info it worked if it ends with ok
gyp verb cli [ 'node', '/bin/nw-gyp', 'rebuild', '--target=0.7.5', '--verbose' ]
gyp info using nw-gyp@0.10.9
gyp info using node@0.10.18 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded for `%s` python /bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.5\n"
gyp verb get node dir compiling against --target node version: 0.7.5
gyp verb command install [ '0.7.5' ]
gyp verb install input version string "0.7.5"
gyp verb installing legacy version? false
gyp verb install installing version: 0.7.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.7.5
gyp verb build dir attempting to create "build" dir: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build
gyp verb build dir "build" dir needed to be created? /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/config.gypi
gyp verb config.gypi checking for gypi file: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/config.gypi
gyp verb common.gypi checking for gypi file: /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn python
gyp info spawn args [ '/usr/lib/node_modules/nw-gyp/gyp/gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/nw-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/xtweetyx/.nw-gyp/0.7.5/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/xtweetyx/.nw-gyp/0.7.5',
gyp info spawn args   '-Dmodule_root_dir=/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/xtweetyx/.nw-gyp/0.7.5
gyp verb `which` succeeded for `make` /bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
  LD_LIBRARY_PATH=/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/Release/lib.host:/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3071700; python ./extract.py ./sqlite-autoconf-3071700.tar.gz "/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build/Release/obj/gen"
  touch Release/obj.target/deps/action_before_build.stamp
  cc '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_REENTRANT=1' '-DSQLITE_THREADSAFE=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_RTREE' '-DNDEBUG' -I/home/xtweetyx/.nw-gyp/0.7.5/src -I/home/xtweetyx/.nw-gyp/0.7.5/deps/uv/include -I/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include -I./Release/obj/gen/sqlite-autoconf-3071700  -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp   -MMD -MF ./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o.d.raw  -c -o Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c: In function ‘porter_stemmer’:
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127208:41: warning: value computed is not used [-Wunused-value]
      stem(&z, "lanoita", "ate", m_gt_0) ||
                                         ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127212:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "icne", "ence", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127225:35: warning: value computed is not used [-Wunused-value]
      stem(&z, "ile", "e", m_gt_0) ||
                                   ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127230:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "noita", "ate", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127236:41: warning: value computed is not used [-Wunused-value]
      stem(&z, "ssenluf", "ful", m_gt_0) ||
                                         ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127241:39: warning: value computed is not used [-Wunused-value]
      stem(&z, "itivi", "ive", m_gt_0) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127250:36: warning: value computed is not used [-Wunused-value]
      stem(&z, "evita", "", m_gt_0)   ||
                                    ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127257:37: warning: value computed is not used [-Wunused-value]
      stem(&z, "laci", "ic", m_gt_0) ||
                                     ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127300:39: warning: value computed is not used [-Wunused-value]
          stem(&z, "tnem", "", m_gt_1) ||
                                       ^
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127320:34: warning: value computed is not used [-Wunused-value]
      stem(&z, "eta", "", m_gt_1) ||
                                  ^
  rm -f Release/obj.target/deps/sqlite3.a && ar crs Release/obj.target/deps/sqlite3.a Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o
  ln -f "Release/obj.target/deps/sqlite3.a" "Release/sqlite3.a" 2>/dev/null || (rm -rf "Release/sqlite3.a" && cp -af "Release/obj.target/deps/sqlite3.a" "Release/sqlite3.a")
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DSQLITE_THREADSAFE=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_RTREE' '-DBUILDING_NODE_EXTENSION' -I/home/xtweetyx/.nw-gyp/0.7.5/src -I/home/xtweetyx/.nw-gyp/0.7.5/deps/uv/include -I/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include -I./Release/obj/gen/sqlite-autoconf-3071700  -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp  -fno-rtti -fno-exceptions  -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/database.o.d.raw  -c -o Release/obj.target/node_sqlite3/src/database.o ../src/database.cc
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/database.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/database.cc:2:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/database.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DSQLITE_THREADSAFE=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_RTREE' '-DBUILDING_NODE_EXTENSION' -I/home/xtweetyx/.nw-gyp/0.7.5/src -I/home/xtweetyx/.nw-gyp/0.7.5/deps/uv/include -I/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include -I./Release/obj/gen/sqlite-autoconf-3071700  -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp  -fno-rtti -fno-exceptions  -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/node_sqlite3.o.d.raw  -c -o Release/obj.target/node_sqlite3/src/node_sqlite3.o ../src/node_sqlite3.cc
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/node_sqlite3.cc:1:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/node_sqlite3.cc:1:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/node_sqlite3.cc:1:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DSQLITE_THREADSAFE=1' '-DSQLITE_ENABLE_FTS3' '-DSQLITE_ENABLE_RTREE' '-DBUILDING_NODE_EXTENSION' -I/home/xtweetyx/.nw-gyp/0.7.5/src -I/home/xtweetyx/.nw-gyp/0.7.5/deps/uv/include -I/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include -I./Release/obj/gen/sqlite-autoconf-3071700  -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp  -fno-rtti -fno-exceptions  -MMD -MF ./Release/.deps/Release/obj.target/node_sqlite3/src/statement.o.d.raw  -c -o Release/obj.target/node_sqlite3/src/statement.o ../src/statement.cc
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/statement.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:41:0: warning: "V8_USE_UNSAFE_HANDLES" redefined [enabled by default]
 #define V8_USE_UNSAFE_HANDLES 1
 ^
In file included from ../src/statement.cc:2:0:
/home/xtweetyx/.nw-gyp/0.7.5/src/node.h:25:0: note: this is the location of the previous definition
 #define V8_USE_UNSAFE_HANDLES
 ^
In file included from /home/xtweetyx/.nw-gyp/0.7.5/src/node.h:66:0,
                 from ../src/statement.cc:2:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/xtweetyx/.nw-gyp/0.7.5/deps/v8/include/v8.h:5740:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
   typedef internal::Internals I;
                               ^
  flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64  -Wl,-soname=node_sqlite3.node -o Release/obj.target/node_sqlite3.node -Wl,--start-group Release/obj.target/node_sqlite3/src/database.o Release/obj.target/node_sqlite3/src/node_sqlite3.o Release/obj.target/node_sqlite3/src/statement.o Release/obj.target/deps/sqlite3.a -Wl,--end-group 
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node: Finished
  ln -f "Release/obj.target/node_sqlite3.node" "Release/node_sqlite3.node" 2>/dev/null || (rm -rf "Release/node_sqlite3.node" && cp -af "Release/obj.target/node_sqlite3.node" "Release/node_sqlite3.node")
make: Leaving directory `/home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/build'
gyp info ok 

The directory /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/lib/binding/Debug/ does not exist after this build. /home/xtweetyx/Projects/datatools/node-webkit/node_modules/sqlite3/lib/binding/ only has a Release directory containing a node-v11-linux-x64 directory which in turn contains the node_sqlite3.node file.

springmeyer commented 10 years ago

It looks like the problem is simply that the original binary (which you built against node) is being used still because the nw-gyp built binary simply rests in Release/node_sqlite3.node while the node-sqlite3 scripts still look in lib/binding/Release/node-v11-linux-x64/. So, can you try this? Within the node-sqlite3 directory do:

cp Release/node_sqlite3.node lib/binding/Release/node-v11-linux-x64/

Then try running it again.

xtweetyx commented 10 years ago

That appears to be the source of the problem. From the node_modules/sqlite3 directory executing

cp ./build/Release/node_sqlite3.node ./lib/binding/Release/node-v11-linux-x64/

allows the application to run properly.

Note the nw-gyp target path is slightly different than mentioned: in build/Release/node_sqlite3.node and not Release/node_sqlite3.node as indicated.

naseerhussain commented 10 years ago

where will be the db file stored in windows 7,.....????

rogerwang commented 10 years ago

@naseerhussain you can use any directory you want.

naseerhussain commented 10 years ago

i'm not getting,..in which file i have to make changes,...???

On Thu, Oct 31, 2013 at 12:33 PM, Roger Wang notifications@github.comwrote:

Closed #1153 https://github.com/rogerwang/node-webkit/issues/1153.

— Reply to this email directly or view it on GitHubhttps://github.com/rogerwang/node-webkit/issues/1153 .

springmeyer commented 10 years ago

note: original problem (solvable with this workaround) is no longer needed with sqlite3@2.2.0. Fixed as part of https://github.com/mapbox/node-sqlite3/pull/245