duckdb / duckdb-node

MIT License
48 stars 23 forks source link

Can't NPM install: node-pre-gyp 403 error #18

Closed rotkohlsuppe closed 2 months ago

rotkohlsuppe commented 10 months ago

Hi, I was trying to install duckdb on my Raspberry 3. I have node 18.18 installed and the latest available precompiled version of duckdb for rpi 0.8.1. Now I was trying to init a new project with npm i duckdb but the list of errors is long. It starts with

npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/home/rotkohlsuppe/duckdb/node_modules/duckdb/build'
npm ERR!   CXX(target) Release/obj.target/duckdb/src/duckdb_node.o
npm ERR!   CXX(target) Release/obj.target/duckdb/src/database.o
npm ERR! make: Leaving directory '/home/rotkohlsuppe/duckdb/node_modules/duckdb/build'
npm ERR! Failed to execute '/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/bin/node /home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --
fallback-to-build --module=/home/rotkohlsuppe/duckdb/node_modules/duckdb/lib/binding/duckdb.node --modu
le_name=duckdb --module_path=/home/rotkohlsuppe/duckdb/node_modules/duckdb/lib/binding --napi_version=9
 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@18.18.2 | linux | arm
npm ERR! node-pre-gyp info check checked for "/home/rotkohlsuppe/duckdb/node_modules/duckdb/lib/binding
/duckdb.node" (not found)
npm ERR! node-pre-gyp http GET https://duckdb-node.s3.amazonaws.com/duckdb-v0.9.1-node-v108-linux-arm.t
ar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://duckdb-node.s3.amazonaws.co
m/duckdb-v0.9.1-node-v108-linux-arm.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for duckdb@0.9.1 and node@18.18.2 (node-v
108 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://duckdb-node.s3.amazonaws.
com/duckdb-v0.9.1-node-v108-linux-arm.tar.gz

Is it possible to make use of the duckdb binary in my local bin folder or do you know the reason for why it fails to install? Thanks in advance! Best, Clemens

carlopi commented 10 months ago

Can you give a try with npm install duckdb@next?

rotkohlsuppe commented 10 months ago

Thank you for your comment! Unfortunately the error is still the same. Maybe the gcc Version is too old. But on RPi Bullseye it's the latest version.

  1. mkdir next && cd next
  2. npm init -y
  3. npm i duckdb@next

Here's the full length of the error message:

npm i duckdb@next
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path /home/rotkohlsuppe/duckdb/next/node_modules/duckdb
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/build'
npm ERR!   CXX(target) Release/obj.target/duckdb/src/duckdb_node.o
npm ERR! make: Leaving directory '/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/build'
npm ERR! Failed to execute '/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/bin/node /home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding/duckdb.node --module_name=duckdb --module_path=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@18.18.2 | linux | arm
npm ERR! node-pre-gyp info check checked for "/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding/duckdb.node" (not found)
npm ERR! node-pre-gyp http GET https://duckdb-node.s3.amazonaws.com/duckdb-v0.9.2-dev22.0-node-v108-linux-arm.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://duckdb-node.s3.amazonaws.com/duckdb-v0.9.2-dev22.0-node-v108-linux-arm.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for duckdb@0.9.2-dev22.0 and node@18.18.2 (node-v108 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://duckdb-node.s3.amazonaws.com/duckdb-v0.9.2-dev22.0-node-v108-linux-arm.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | linux | arm
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | linux | arm
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/rotkohlsuppe/.cache/node-gyp/18.18.2/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/rotkohlsuppe/.cache/node-gyp/18.18.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/rotkohlsuppe/.cache/node-gyp/18.18.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | linux | arm
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! g++: fatal error: Killed signal terminated program cc1plus
npm ERR! compilation terminated.
npm ERR! make: *** [duckdb.target.mk:471: Release/obj.target/duckdb/src/duckdb_node.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Linux 6.1.21-v7+
npm ERR! gyp ERR! command "/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/bin/node" "/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding/duckdb.node" "--module_name=duckdb" "--module_path=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /home/rotkohlsuppe/duckdb/next/node_modules/duckdb
npm ERR! gyp ERR! node -v v18.18.2
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/bin/node /home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding/duckdb.node --module_name=duckdb --module_path=/home/rotkohlsuppe/duckdb/next/node_modules/duckdb/lib/binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/rotkohlsuppe/duckdb/next/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:303:5)
npm ERR! node-pre-gyp ERR! System Linux 6.1.21-v7+
npm ERR! node-pre-gyp ERR! command "/home/rotkohlsuppe/node/node-v18.18.2-linux-armv7l/bin/node" "/home/rotkohlsuppe/duckdb/next/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/rotkohlsuppe/duckdb/next/node_modules/duckdb
npm ERR! node-pre-gyp ERR! node -v v18.18.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

Here's my gcc -v after apt update / upgrade, which is the latest stable version on Debian Bullseye:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/10/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 10.2.1-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Raspbian 10.2.1-6+rpi1)
Mause commented 8 months ago

The build looks like it's failing due to running out of memory unfortunately - and we don't provide pre-builds for armv7l, only arm64

rotkohlsuppe commented 7 months ago

The build looks like it's failing due to running out of memory unfortunately - and we don't provide pre-builds for armv7l, only arm64

Too bad, but thanks for inspecting the problem!

Mause commented 7 months ago

You may be able to get it to build yourself locally, using lower concurrency, but no promises