Error with Sqlite and NodeJS binaries

System Information
  • Strapi Version: V4
  • Operating System: macOS Big Sur 11.6 (running on M1 Mac)
  • Database: SqLite
  • Node Version: 14.18.2
  • NPM Version: 6.14.15
  • Yarn Version:

Hi There, I am running into the following error when trying to setup Strapi. I have looked through other issues and have not found one similar to mine, hence why I am posting here.
Thanks in advance.

Error while installing dependencies:
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 uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated mailcomposer@3.12.0: This project is unmaintained
npm WARN deprecated @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
npm WARN deprecated buildmail@3.10.0: This project is unmaintained
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.2 and node@14.18.2 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
/bin/sh: Website/backend/node_modules/sqlite3/build/Release/lib.host:/Users/matthew/Documents/Coding/Personal: No such file or directory
Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:744:17: warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation]
  "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
                ^
               ,
Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:56:27: note: expanded from macro 'CTIMEOPT_VAL'
#define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt)
                          ^
Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:55:28: note: expanded from macro 'CTIMEOPT_VAL_'
#define CTIMEOPT_VAL_(opt) #opt
                           ^
<scratch space>:5:1: note: expanded from here
"1"
^
Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c:744:3: note: place parentheses around the string literal to silence warning
  "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
  ^
1 warning generated.
clang: error: no such file or directory: 'Website/backend/node_modules/sqlite3/node_modules/node-addon-api'
make: *** [Release/obj.target/node_sqlite3/src/backup.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/matthew/.nvm/versions/node/v14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/matthew/.nvm/versions/node/v14.18.2/bin/node" "/Users/matthew/.nvm/versions/node/v14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3
gyp ERR! node -v v14.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/matthew/.nvm/versions/node/v14.18.2/bin/node /Users/matthew/.nvm/versions/node/v14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1058:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
node-pre-gyp ERR! System Darwin 20.6.0
node-pre-gyp ERR! command "/Users/matthew/.nvm/versions/node/v14.18.2/bin/node" "/Users/matthew/Documents/Coding/Personal Website/backend/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/matthew/Documents/Coding/Personal Website/backend/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.18.2
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
npm WARN notsup Unsupported engine for redis@4.0.1: wanted: {"npm":">=7"} (current: {"node":"14.18.2","npm":"6.14.15"})
npm WARN notsup Not compatible with your version of node/npm: redis@4.0.1
npm WARN @strapi/helper-plugin@4.0.2 requires a peer of qs@6.10.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-virtualized@9.22.3 requires a peer of react@^15.3.0 || ^16.0.0-alpha but none is installed. You must install peer dependencies yourself.
npm WARN react-virtualized@9.22.3 requires a peer of react-dom@^15.3.0 || ^16.0.0-alpha but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@5.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@5.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthew/.npm/_logs/2021-12-29T04_09_36_345Z-debug.log

 Keep trying!             

Does your package.json include sqlite ? If so I would maybe suggest downgrade to 5.0.1 or 5.0.2 seems people have issues with it (It’s reported on github

Thanks for the suggestion, and I probably should have mentioned in my original post, but I did come across some of those comments, but unfortunately my package.json does include sqlite, and when I try to downgrade the version, I get a different error that says the file https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.0/napi-v3-darwin-arm64.tar.gz cannot be found (same error for 5.0.0 and 5.0.1).

I have also tried simply using npm to manually install sqlite (5.0.0, 5.0.1, and 5.0.2) and end up getting the same error. Any other suggestions?