Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Trying to install sqlite3 on a raspberry pi

I'm trying to install sqlite3 via it's npm module one a raspberry pi but I get this error and it doesn't install

npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/build'
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   AR(target) Release/obj.target/../node-addon-api/nothing.a
npm ERR!   COPY Release/nothing.a
npm ERR!   ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c
npm ERR!   TOUCH Release/obj.target/deps/action_before_build.stamp
npm ERR!   CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3340000/sqlite3.o
npm ERR!   AR(target) Release/obj.target/deps/sqlite3.a
npm ERR!   COPY Release/sqlite3.a
npm ERR!   CXX(target) Release/obj.target/node_sqlite3/src/backup.o
npm ERR! make: Leaving directory '/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/build'
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@16.6.1 | linux | arm
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-arm.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-arm.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-arm.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.2 and node@16.6.1 (node-v93 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-arm.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.6.1 | 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@7.1.2
npm ERR! gyp info using node@16.6.1 | linux | arm
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! (node:25395) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/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/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/pi/.cache/node-gyp/16.6.1/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/pi/.cache/node-gyp/16.6.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/pi/.cache/node-gyp/16.6.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3',
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@7.1.2
npm ERR! gyp info using node@16.6.1 | linux | arm
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! /bin/sh: 1: Bot/node_modules/sqlite3/build/Release/lib.host:/home/pi/Applications/customApps/Discord/Programmers: not found
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c: In function ‘cellArea’:
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190977:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 5:  area  = p->aCoord[9].f - p->aCoord[8].f;
npm ERR!                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190978:7: note: here
npm ERR!        case 4:  area *= p->aCoord[7].f - p->aCoord[6].f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190978:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 4:  area *= p->aCoord[7].f - p->aCoord[6].f;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190979:7: note: here
npm ERR!        case 3:  area *= p->aCoord[5].f - p->aCoord[4].f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190979:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 3:  area *= p->aCoord[5].f - p->aCoord[4].f;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190980:7: note: here
npm ERR!        case 2:  area *= p->aCoord[3].f - p->aCoord[2].f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190980:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 2:  area *= p->aCoord[3].f - p->aCoord[2].f;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190981:7: note: here
npm ERR!        default: area *= p->aCoord[1].f - p->aCoord[0].f;
npm ERR!        ^~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190987:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 5:  area  = (i64)p->aCoord[9].i - (i64)p->aCoord[8].i;
npm ERR!                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190988:7: note: here
npm ERR!        case 4:  area *= (i64)p->aCoord[7].i - (i64)p->aCoord[6].i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190988:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 4:  area *= (i64)p->aCoord[7].i - (i64)p->aCoord[6].i;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190989:7: note: here
npm ERR!        case 3:  area *= (i64)p->aCoord[5].i - (i64)p->aCoord[4].i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190989:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 3:  area *= (i64)p->aCoord[5].i - (i64)p->aCoord[4].i;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190990:7: note: here
npm ERR!        case 2:  area *= (i64)p->aCoord[3].i - (i64)p->aCoord[2].i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190990:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        case 2:  area *= (i64)p->aCoord[3].i - (i64)p->aCoord[2].i;
npm ERR!                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190991:7: note: here
npm ERR!        default: area *= (i64)p->aCoord[1].i - (i64)p->aCoord[0].i;
npm ERR!        ^~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c: In function ‘rtreeCallbackConstraint’:
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190130:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+32, &c); aCoord[8] = c.f;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190131:7: note: here
npm ERR!        case 8:   readCoord(pCellData+28, &c); aCoord[7] = c.f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190132:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+24, &c); aCoord[6] = c.f;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190133:7: note: here
npm ERR!        case 6:   readCoord(pCellData+20, &c); aCoord[5] = c.f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190134:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+16, &c); aCoord[4] = c.f;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190135:7: note: here
npm ERR!        case 4:   readCoord(pCellData+12, &c); aCoord[3] = c.f;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190136:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+8,  &c); aCoord[2] = c.f;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190137:7: note: here
npm ERR!        default:  readCoord(pCellData+4,  &c); aCoord[1] = c.f;
npm ERR!        ^~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190145:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+32, &c); aCoord[8] = c.i;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190146:7: note: here
npm ERR!        case 8:   readCoord(pCellData+28, &c); aCoord[7] = c.i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190147:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+24, &c); aCoord[6] = c.i;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190148:7: note: here
npm ERR!        case 6:   readCoord(pCellData+20, &c); aCoord[5] = c.i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190149:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+16, &c); aCoord[4] = c.i;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190150:7: note: here
npm ERR!        case 4:   readCoord(pCellData+12, &c); aCoord[3] = c.i;
npm ERR!        ^~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190151:56: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!                  readCoord(pCellData+8,  &c); aCoord[2] = c.i;
npm ERR!                                               ~~~~~~~~~~^~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190152:7: note: here
npm ERR!        default:  readCoord(pCellData+4,  &c); aCoord[1] = c.i;
npm ERR!        ^~~~~~~
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c: In function ‘rtreeNonleafConstraint’:
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190207:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR!        if( p->op!=RTREE_EQ ) break;  /* RTREE_LE and RTREE_LT end here */
npm ERR!          ^
npm ERR! Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:190210:5: note: here
npm ERR!      default: /* RTREE_GT or RTREE_GE,  or fallthrough of RTREE_EQ */
npm ERR!      ^~~~~~~
npm ERR! g++: error: Bot/node_modules/node-addon-api: No such file or directory
npm ERR! make: *** [node_sqlite3.target.mk:138: Release/obj.target/node_sqlite3/src/backup.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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.72-v7l+
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3
npm ERR! gyp ERR! node -v v16.6.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3/lib/binding/napi-v3-linux-arm --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Linux 5.4.72-v7l+
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/pi/Applications/customApps/Discord/Programmers Bot/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v16.6.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-08-29T22_16_26_315Z-debug.log

So I tried installing sqlite3 directly but then it's not in the package.json file and I get the error

Please install sqlite3 package manually

1 Answer

Clint Oka
Clint Oka
5,768 Points

Anyone has a solution to this problem?