I've been trying to download sqlite3@4.2.0, however it's been giving me an error. Here are the logs when trying to run npm 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
> sqlite3@4.2.0 install /Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-darwin-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.17.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/crypthusiast0/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.4.0
gyp ERR! command "/Users/crypthusiast0/.nvm/versions/node/v14.17.0/bin/node" "/Users/crypthusiast0/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3
gyp ERR! node -v v14.17.0
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/crypthusiast0/.nvm/versions/node/v14.17.0/bin/node /Users/crypthusiast0/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:376:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 20.4.0
node-pre-gyp ERR! command "/Users/crypthusiast0/.nvm/versions/node/v14.17.0/bin/node" "/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/crypthusiast0/.nvm/versions/node/v14.17.0/bin/node /Users/crypthusiast0/.nvm/versions/node/v14.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/crypthusiast0/Dev/nodejs/auction-flipper/node_modules/sqlite3/lib/binding/node-v83-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN node-auction-flipper@0.1.0 No repository field.
npm WARN node-auction-flipper@0.1.0 license should be a valid SPDX license expression
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.2.0 install: `node - pre - gyp install--fallback - to - build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.2.0 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/crypthusiast0/.npm/_logs/2021-06-10T21_46_58_721Z-debug.log
I looked back at the logs to see that https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-darwin-arm64.tar.gz is probably the main cause of this because if you actually go to the link, it gives you this error:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>Q0JKD48B1117QG62</RequestId>
<HostId>0tR6ildiySR62EjZI4DwfeVbxSFIOClQUiIyMCySpd/lficx42uEJ2YU94GtQQvMnF4EENuWH/0=</HostId>
</Error>
I'n not entirely sure how to fix this because I'm not very experienced with Node.js/NPM and installing modules, however I do need node-sqlite3 specifically version 4.2.0 because one of my VSCode extensions relies on it. I have found the github repo of node-sqlite and the 4.2.0 source code. Is there any way to fix this or compile the module from source? Maybe could it be because it's not supported on my node version/os? I had this working before so I'm not sure.
I'm on a MacBook Air M1 (ARM) running node version v16.3.0 and npm version v7.16.0.