Using WSL to build sqlite3 for Raspi (ARM)

269 Views Asked by At

I want build sqlite3 in my WSL (using Debian on a 64-bit machine) to deploy it on my raspberry.

I am using the following command

npm install sqlite3 --build-from-source --target_arch=arm --target_platform=linux --save

The module is built: node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node

But, it is not an ARM module. If I open node_sqlite3.node, it does not contain any .ARM files.

package.json:

"sqlite3": "^5.0.0",

Here package-lock.json

"sqlite3": {
  "version": "5.0.0",
  "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.0.tgz",
  "integrity": "sha512-rjvqHFUaSGnzxDy2AHCwhHy6Zp6MNJzCPGYju4kD8yi6bze4d1/zMTg6C7JI49b7/EM7jKMTvyfN/4ylBKdwfw==",
  "requires": {
    "node-addon-api": "2.0.0",
    "node-gyp": "3.x",
    "node-pre-gyp": "^0.11.0"
  }
},

If I want to start the project on the raspberry, i get the following error:

node_modules/sqlite3/lib/binding/node-v83-linux-arm/node_sqlite3.node: wrong ELF class: ELFCLASS64

It does not build for ARM, although it is set.

0

There are 0 best solutions below