Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building node-sqlite3 with nw-gyp

I am trying to build sqlite3 for a node-webkit.

The sqlite3 page explains that it needs to be done with with nw-gyp

As far as I understand it, I should download the source locally and then navigate to the src folder and run this (shown here):

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)

Thing is, whatever location I run that command, I get these errors:

  • npm WARN package.json [email protected] No licence field.
  • npm WARN install Refusing to install sqlite3 as a dependency of itself
  • npm WARN node-pre-gyp was bundled with [email protected], but bundled package wasn't found in unpacked tree.

Maybe I am doing this totally wrong, I just don't know :)

NW-gyp version: V0.12.4 Node-webkit version: 0.12.3

OS: Windows 7

I made small step toward the success, but not yet there. It seems that I should try that command in empty folder. So I did, but I have loads of errors now.

The very first error is:

ERROR: Empty target version is not supported if node-webkit is the target. Then it is followed with many STACK errors.

The first stack one is: at get_node_webkit_abi (full path of the file) utils/versioning.js

MORE Updates: This command removed many errors:

 npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3

Then there was error that Pything can't be found. That is fixed. Still more error, now with C++ compilers. I think I have complete mess with NET redistributables.

Next error in line is: error MSB6006: "CL.exe" exited with code -1073741515

This is the error I am getting now: enter image description here

More improvements. I am getting error: undefined variable module_name in binding.gyp enter image description here

Next steps I did:

  • I installed npm install -g node-pre-gyp

  • Than I run node-pre-gyp rebuild --runtime=node-webkit --target=0.12.3

  • That gave me error missing nan module missing

  • I installed it

  • And I am getting the same screen as in first screenshot (MSB6006).

like image 959
Wexoni Avatar asked Mar 03 '26 23:03

Wexoni


1 Answers

I managed to build using the following commands on mac:

sudo npm install nw-gyp -g
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3

First, make sure you installed nw-gyp globally. Then, run the command either in the directory containing node-webkit executables (nwjs), or in a subfolder of that folder.

Running the command should then create a node_modules folder in the same directory as the binaries, containing the sqlite3 module.

like image 191
Kuf Avatar answered Mar 05 '26 13:03

Kuf