Skip to content

SQLCipher path errors with incorrect system architecture detection #111

@saintsatplay2015

Description

@saintsatplay2015

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: capacitor-community/sqlite#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 capacitor-community/sqlite#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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions