You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
I'm trying to use this module on some arm64 devices and our build times are really long because there is no prebuilt binary for us.
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v57-linux-arm64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@8.9.0 (node-v57 ABI) (falling back to source compile with node-gyp)
I'm using the new LTS version of node.
You can reproduce this on a raspberry pi 3 using https://github.com/bamarni/pi64 which gives a 64-bit kernel. It does eventually compile from source, but every time uses about 15 minutes of time.
Reacted by Robin, John Elliott, Sam Mellor, ewnd9, Manuel Bl., M.vd.L, James Gentes, Joseph Hughes, Pavel Djundik, Ke Wang and 10 more
Yes, this would really help users. To make providing an arm64 binary sustainable for each release, we'd need an automated way of doing this. Do you have suggestions on how to script building for arm64 on travis (or similar free CI infra)?
There is no ./lib/binding folder at all FWIW, which leads me to believe more it didn't try building the binary.
Odd, @creationix can you try passing --build-from-source to your npm rebuild command? Without that node-pre-gyp will be attempting to install from a remote binary each time, by default. Clearly something is wrong with the fallback though that I can't tell from your logs.
Assuming your CI server has support for qemu-aarch64-static and docker, something like the following should work:
FROM arm64v8/node:carbon
COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static
RUN apt-get update
RUN apt-get install -y git build-essential
RUN git clone --depth=1 https://github.com/mapbox/node-sqlite3.git
WORKDIR /node-sqlite3
RUN make
See this article for more details on using qemu for cross-compiling with docker.
and another ARM user here. I've been trying all sorts of tricks to get this to build on my raspi without success. Please add pre built binary to the repo... thanks a lot!
With docker buildx it is quite easy to build binaries for multiple platforms.
We are currently using it for building docker images for all platforms. We could incorporate it into the CI for easily generating pre-built binaries for SQLite.
I think it would be as easy as cloning this repository, running npm install --ignore-scripts and npx node-pre-gyp install --build-from-source and then upload the build artifacts.
A matrix could then cover all the platforms e.g. linux/arm/v6, linux/arm/v7, linux/arm64
@n1ru4l thanks for the PR. I could successfully generate the binaries using docker buildx, but I can't get npm and node-pre-gyp to use them.
When passing --source=napi-v3-linux-arm64.tar.gz, node-pre-gyp keeps trying to download it on s3 (and fails with error 403).
I'm almost there... How can I specify to node-pre-gyp that he should take my local file instead of fetching it over the distant repo?
So all you have to do is to extract the node_sqlite3.node file from the tar.gz produced by docker buildx and place it in the node_module/sqlite3/lib/binding/napi-v3-linux-[ARCH]/node_sqlite3.node folder.
In my case I also had to delete first the project's node_modules folder to make it work (my previous commands had probably generated some invalid cache).
I wanted to workaround this while doing an npm ci which sadly meant I couldn't put the .node file in its final location.
This will let you host the binaries somewhere:
npm ci --node_sqlite3_binary_host_mirror=https://somehost
It'll try and download from http://somehost/sqlite3/v5.0.1/napi-v6-linux-arm64.tar.gz (the filename is the same name as the folder in lib/binding napi-v[NAPI_VERSION]-linux-[ARCH])
The tarball contains the folder from ../node_modules/sqlite3/lib/binding and in it the node_sqlite3.node file
Thanks for the workaround @tom-boothman, for some reason placing the file locally would sometimes not work for me, probably because I must use an older version of node-pre-gyp.
Having to upload the file on Internet while it's available on the very same device is quite an overkill but it does the job...
Activity
creationix commentedon Nov 6, 2017
Hmm, actually, I'm having trouble build from source in some cases as well.
I don't think it even tried to build from source when I initially ran
npm installandnpm rebuilddoesn't seem to do anything.Any ideas how I can debug
node-prep-gypissues here?creationix commentedon Nov 6, 2017
There is no
./lib/bindingfolder at all FWIW, which leads me to believe more it didn't try building the binary.springmeyer commentedon Nov 7, 2017
Yes, this would really help users. To make providing an arm64 binary sustainable for each release, we'd need an automated way of doing this. Do you have suggestions on how to script building for arm64 on travis (or similar free CI infra)?
Odd, @creationix can you try passing
--build-from-sourceto yournpm rebuildcommand? Without thatnode-pre-gypwill be attempting to install from a remote binary each time, by default. Clearly something is wrong with the fallback though that I can't tell from your logs.creationix commentedon Nov 8, 2017
Assuming your CI server has support for
qemu-aarch64-staticand docker, something like the following should work:See this article for more details on using qemu for cross-compiling with docker.
johnelliott commentedon Nov 24, 2017
Another raspberry pi 3 node-sqlite user here. Pre-built would be wonderful 👍
SridharRamasami commentedon Mar 1, 2018
One more raspberry pi 3 user here.
lucianodlf commentedon Mar 17, 2018
another user is added to the order
rzr commentedon Aug 8, 2018
I guess this could be built on qemu , check this related change:
#1028
k1r0s commentedon Sep 16, 2018
yet another non amd64 user
rzr commentedon Sep 17, 2018
Relate to: #1028
Slos commentedon Nov 8, 2018
and another ARM user here. I've been trying all sorts of tricks to get this to build on my raspi without success. Please add pre built binary to the repo... thanks a lot!
dvilelaf commentedon Nov 9, 2018
And another one user. Couldn't make it work on a raspberry pi zero w.
rzr commentedon Nov 9, 2018
have you tried to build in docker ? may I also request this package to land in debian too
https://tracker.debian.org/pkg/node-sqlite3
songzhuang commentedon Nov 9, 2018
Hi,
I can volunteer to create the build for the Pi. If someone knows the steps, please point me to it. I guess it would be:
Regards,
rzr commentedon Nov 9, 2018
Well I used this PR to build offline:
#1028
@songzhuang you can try to see how this can be adapted for arm64 for @k1r0s
Good luck
3 remaining items
tools: Crossbuild for ARMv8-64
tools: Crossbuild for ARMv8-64
tools: Crossbuild for ARMv8-64 (#1147)
n1ru4l commentedon Jul 21, 2020
With docker buildx it is quite easy to build binaries for multiple platforms.
We are currently using it for building docker images for all platforms. We could incorporate it into the CI for easily generating pre-built binaries for SQLite.
I think it would be as easy as cloning this repository, running
npm install --ignore-scriptsandnpx node-pre-gyp install --build-from-sourceand then upload the build artifacts.A matrix could then cover all the platforms e.g.
linux/arm/v6, linux/arm/v7, linux/arm64louisabraham commentedon Aug 22, 2020
Any update?
n1ru4l commentedon Aug 22, 2020
@louisabraham I created this PR that adds binaries, feel free to review and test the binaries. #1362
louisabraham commentedon Nov 1, 2020
Thank you so much, they work!
gpetrov commentedon Dec 13, 2020
Any progress in making the binaries officially available?
I'm getting:
Note linux/arm64 binaries are very important for the upcoming Docker Desktop for Apple Silicon M1 as those will run natively there.
dark-matter-matters commentedon Mar 19, 2021
@n1ru4l thanks for the PR. I could successfully generate the binaries using
docker buildx, but I can't get npm and node-pre-gyp to use them.When passing
--source=napi-v3-linux-arm64.tar.gz, node-pre-gyp keeps trying to download it on s3 (and fails with error 403).I'm almost there... How can I specify to node-pre-gyp that he should take my local file instead of fetching it over the distant repo?
n1ru4l commentedon Mar 19, 2021
You have to place it in a very specific folder so that the cache is hit. I don't remember the exact path though.
dark-matter-matters commentedon Mar 21, 2021
Thanks for the heads up. The location is shown in the error log file of npm just before the 403 response:
So all you have to do is to extract the node_sqlite3.node file from the tar.gz produced by docker buildx and place it in the
node_module/sqlite3/lib/binding/napi-v3-linux-[ARCH]/node_sqlite3.nodefolder.In my case I also had to delete first the project's node_modules folder to make it work (my previous commands had probably generated some invalid cache).
I hope they pull your PR soon to avoid this!
tom-boothman commentedon May 28, 2021
I wanted to workaround this while doing an npm ci which sadly meant I couldn't put the .node file in its final location.
This will let you host the binaries somewhere:
It'll try and download from http://somehost/sqlite3/v5.0.1/napi-v6-linux-arm64.tar.gz (the filename is the same name as the folder in lib/binding napi-v[NAPI_VERSION]-linux-[ARCH])
The tarball contains the folder from ../node_modules/sqlite3/lib/binding and in it the node_sqlite3.node file
dark-matter-matters commentedon Jun 21, 2021
Thanks for the workaround @tom-boothman, for some reason placing the file locally would sometimes not work for me, probably because I must use an older version of node-pre-gyp.
Having to upload the file on Internet while it's available on the very same device is quite an overkill but it does the job...
daniellockyer commentedon Apr 14, 2022
This has been shipped in
masterand will be released soon 🙂