Better-sqlite3: Installation of module fails

Created on 1 Mar 2018  路  4Comments  路  Source: JoshuaWise/better-sqlite3

Sorry!
What am I doing wrong?

macbook:node raymond$ npm -v
5.6.0

macbook:node raymond$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

macbook:node raymond$ npm install better-sqlite3

> [email protected] install /Users/raymond/stack/node/node_modules/integer
> node tools/install

  CXX(target) Release/obj.target/integer/src/integer.o
  SOLINK_MODULE(target) Release/integer.node

> [email protected] install /Users/raymond/stack/node/node_modules/better-sqlite3
> node deps/install

==> cwd: /Users/raymond/stack/node/node_modules/better-sqlite3
==> /Users/raymond/stack/node/node_modules/lzz-gyp/lzz-compiled/osx -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz
==> cwd: /Users/raymond/stack/node/node_modules/better-sqlite3
==> node-gyp rebuild
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3210000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3210000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
Usage: /usr/local/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool:   error: unrecognised option: '-static'
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/raymond/stack/node/node_modules/better-sqlite3
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Error: exit code 1
    at ChildProcess.<anonymous> (/Users/raymond/stack/node/node_modules/lzz-gyp/lib/exec.js:19:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node deps/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/raymond/.npm/_logs/2018-03-01T08_40_06_263Z-debug.log
help wanted

Most helpful comment

This worked for me:

  1. First, I had Visual C++ 2013 installed, then configured globally by running npm config set msvs_version 2013 --global
  2. Then I ran an installation of node-gyp by running npm install node-gyp -g node-gyp
  3. Finally, I installed Sqlite3 by running npm install sqlite3

Find it here: https://stackoverflow.com/questions/40461439/error-installing-sqlite3-in-node-js

All 4 comments

I believe your node-gyp toolchain is using the wrong version of some dependency. See this comment which may help you

Hm, it seems that the version I currently have is okay...

macbook:~ raymond$ libtool --version
libtool (GNU libtool) 2.4.6
Written by Gordon Matzigkeit, 1996

This worked for me:

  1. First, I had Visual C++ 2013 installed, then configured globally by running npm config set msvs_version 2013 --global
  2. Then I ran an installation of node-gyp by running npm install node-gyp -g node-gyp
  3. Finally, I installed Sqlite3 by running npm install sqlite3

Find it here: https://stackoverflow.com/questions/40461439/error-installing-sqlite3-in-node-js

@vieiralc This works me (windows), but @focussing is on a Mac.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Silve2611 picture Silve2611  路  6Comments

imtbl picture imtbl  路  6Comments

ccpwcn picture ccpwcn  路  4Comments

horpto picture horpto  路  4Comments

DrDonkeyPunch picture DrDonkeyPunch  路  5Comments