journeyapps / node-sqlcipher

SQLCipher bindings for Node
https://journeyapps.com
BSD 3-Clause "New" or "Revised" License
207 stars 66 forks source link

node-pre-gyp info This Node instance does not support builds for N-API version 6 #68

Closed ajmasia closed 3 years ago

ajmasia commented 3 years ago

Fails on W10 with node v12.16.3

rkistner commented 3 years ago

Please check #65.

ajmasia commented 3 years ago

Hi, @rkistner again,

I've created a playground repo to test the new version https://github.com/ajmasia/electron-sqlite-playground When run dev server for windows, the app close after run:

Capture

I'm using Electron 9.0.0 and Node v10.19.0 that's support N_API 3

Dependence is built correctly:

Capture1

When you remove the pragma config works fine

  // This is the default, but it is good to specify explicitly:
    db.run('PRAGMA cipher_compatibility = 4')
    console.log('Pragma cipher compatibility defined')

    // To open a database created with SQLCipher 3.x, use this:
    // db.run("PRAGMA cipher_compatibility = 3");

    db.run("PRAGMA key = 'mysecret'")

This means that it does not seem to compile well for windows because the database cannot be encrypted.

On mac works fine, any idea?

Thanks!

rkistner commented 3 years ago

Working on a fix for Windows. This is the same issue as in #67, so moving the discussion there.

Note that the issue title (node-pre-gyp info This Node instance does not support builds for N-API version 6) is unrelated to the actual crash - that's just an informational message.

ajmasia commented 3 years ago

Thanks, @rkistner for star working on this fix, and sorry for my title mistake 😄