Native Module

13 views
Skip to first unread message

Mike Parsons

unread,
Feb 2, 2013, 1:58:38 PM2/2/13
to node-...@googlegroups.com
I'm trying to use a native sqlite3 module (https://github.com/developmentseed/node-sqlite3) in a node-webkit app on windows (x64)

It works fine with the latest version of node but when I try to include it into a node-webkit app ... it doesn't seem to want to load the native module. I've re-compiled the module for win32 and tested it with regular node and it all works fine but when I try to require the module, I get this error

%1 is not a valid Win32 application.

I can download the 32-bit node from nodejs.org and include the module and it works just fine.

Any ideas on how I could get this to work?

The code is very simple ...

try {
var sqlite3 = require('sqlite3');
var db = new sqlite3.Database(':memory:');

db.serialize(function() {
 
 db.each("SELECT sqlite_version() as version", function(err, row) {
 document.body.innerHTML+=row.version;
 });
});

db.close();
}
catch(e) {
document.body.innerHTML+=e.message;
}


Roger WANG

unread,
Feb 2, 2013, 10:46:25 PM2/2/13
to Mike Parsons, node-...@googlegroups.com
Mike Parsons <mike.r....@gmail.com> writes:

> I'm trying to use a native sqlite3 module (
> https://github.com/developmentseed/node-sqlite3) in a node-webkit app on
> windows (x64)
>
> It works fine with the latest version of node but when I try to include it
> into a node-webkit app ... it doesn't seem to want to load the native
> module. I've re-compiled the module for win32 and tested it with regular
> node and it all works fine but when I try to require the module, I get this
> error

Did you build it with 'nw-gyp'? and did you rename 'nw.exe' to anything
else?

For the renaming issue see
https://github.com/rogerwang/node-webkit/issues/199

For building with 'nw-gyp' see
https://github.com/rogerwang/node-webkit/wiki/Build-native-modules-with-nw-gyp

--
Roger WANG Intel Open Source Technology Center

Mike Parsons

unread,
Feb 5, 2013, 8:37:21 AM2/5/13
to node-...@googlegroups.com, Mike Parsons
Thanks Roger ... this did the trick!

Another questions ... can I build an x64 executable on windows 7?

abeq

unread,
Feb 5, 2013, 7:40:30 PM2/5/13
to node-...@googlegroups.com
Hi, Roger

Is there any plan for issue#199 to be corrected? 

abeq


2013年2月3日日曜日 11時46分25秒 UTC+8 Roger WANG:

Roger WANG

unread,
Feb 5, 2013, 8:00:22 PM2/5/13
to abeq, node-...@googlegroups.com
abeq <abeq...@gmail.com> writes:

> Hi, Roger
>
> Is there any plan for issue#199 to be corrected?

It's on my plan to fix it. But there is no scheduled time.

Roger WANG

unread,
Feb 5, 2013, 8:01:04 PM2/5/13
to Mike Parsons, node-...@googlegroups.com
Mike Parsons <mike.r....@gmail.com> writes:

> Thanks Roger ... this did the trick!
>
> Another questions ... can I build an x64 executable on windows 7?

no. Currently only 32bit binaries can be built on Windows and OSX.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages