2
votes

I've got a package that requires the node-sqlite3 package. However, it also requires that node-sqlite3 be built with sqlcipher support, or my package will fail to function correctly.

I am installing node-sqlite3 using:

export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include/"
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/local/lib --save

However, when I am done and look at my package.json, it merely says:

"sqlite3": "^3.1.8"

There is no mention about the sqlcipher requirement. If I naively try to install my package with this requirement, it doesn't build with sqlcipher support, and my app fails because it is unable to read the sqlcipher encrypted databases, even when the proper key is present!

Furthermore, on a different platform there is no guarantee that sqlcipher would be installed in the same location, although to make the problem a bit simpler we can assume it is already built and exists somewhere.

How do I properly specify this dependency requirement?

Hey @Michael, did you ever find an answer for this? - Matt Votsikas McLean
@MattVotsikas I found the cross-sqlcipher which appears to solve the problem using multiple optional packages, one for each platform, but I don't know if it properly handles failures (since it doesn't stop on failure of any of the irrelevant platforms to install). In any case, it seems so far to be a suitable workaround. - Michael