node-sqlcipher icon indicating copy to clipboard operation
node-sqlcipher copied to clipboard

SQLCipher path errors with incorrect system architecture detection

Open saintsatplay2015 opened this issue 2 years ago • 0 comments

I am encountering an issue with the sqlcipher module throwing up an error, when used in the Capacitor/SQLite plugin for publishing through Electron as detailed here: https://github.com/capacitor-community/sqlite/issues/421

The dependency error is reported as follows:

Cannot find module '/Volumes/Projects/htdocs/electron-ionic/ionic-sqlite/electron/node_modules/@journeyapps/sqlcipher/lib/binding/napi-v6-darwin-arm64/node_sqlite3.node

When I check the electron directory for this path I get the following:

/Volumes/Projects/htdocs/electron-ionic/ionic-sqlite/electron/node_modules/@journeyapps/sqlcipher/lib/binding/napi-v6-darwin-x64/node_sqlite3.node

The installed binding directory is napi-v6-darwin-x64 NOT napi-v6-darwin-arm64.

This issue appears to relate with incorrectly determining the MacOS Ventura/M1 chip MacBook architecture:

Screenshot 2023-05-26 at 18 05 08

Unfortunately, this is also able to be replicated on an Intel based Mac system with the following stats:

  • Mac OS
  • Monterey 12.4
  • Intel Quad-Core i7
  • MB Pro 2016

In this instance, when attempting to run the npm run electron:start command (for the project related to https://github.com/capacitor-community/sqlite/issues/421 I get the following error:

intel-chip-mac-issue-1

However this time there is NO directory being generated in the location where the error occurs:

intel-chip-mac-issue-2

In each instance the sqlcipher does not contain the correct expected directory reference (that the error throws up).

Is there a workaround/solution to this?

saintsatplay2015 avatar Jun 15 '23 16:06 saintsatplay2015