SQLCipher path errors with incorrect system architecture detection
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:
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:
However this time there is NO directory being generated in the location where the error occurs:
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?