Cannot install npm packages in debian google cloud platform - node.js

I am trying to run my bot using google cloud and discord.js. But when I install npm packages it shows up with a lot of errors. I am a real newbie with google cloud and currently using debian 10 on GCP. Here is the error code. On internet I didn't find a possible solution.
I think the problem is with nodegit or node-pre-gyp. Can anyone help me pls?
npm WARN deprecated dblapi.js#2.4.1: Module is no longer maintained
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 snekfetch#4.0.4: use node-fetch instead
npm WARN deprecated canvas-constructor#3.2.0: Discontinued Support: please update to latest version
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated node-pre-gyp#0.13.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 discord.js#12.5.3: no longer supported
npm WARN deprecated node-opus#0.3.3: This project is unmaintained. See #discordjs/opus for an alternative.
npm ERR! code 1
npm ERR! path /home/info/Fab/node_modules/nodegit
npm ERR! command failed
npm ERR! command sh -c node lifecycleScripts/preinstall && node lifecycleScripts/install
npm ERR! [nodegit] Running pre-install script
npm ERR! [nodegit] Running install script
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/info/Fab/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/home/info/Fab/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp
npm ERR! info it worked if it ends with ok
npm ERR! node-pre-gyp
npm ERR! info using node-pre-gyp#0.1.0
npm ERR! node-pre-gyp info using
npm ERR! node#16.11.1 | linux | x64
npm ERR! node-pre-gyp WARN
npm ERR! Using request for node-pre-gyp https download
npm ERR! node-pre-gyp
npm ERR! info check checked for "/home/info/Fab/node_modules/nodegit/build/Release/nodegit.node" (not found)
npm ERR! node-pre-gyp
npm ERR! http GET https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-linux-x64.tar.gz
npm ERR! node-pre-gyp
npm ERR! http 404 https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-linux-x64.tar.gz
npm ERR! node-pre-gyp
npm ERR! WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-linux-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for nodegit#0.27.0 and node#16.11.1 (node-v93 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v93-linux-x64.tar.gz
npm ERR! gyp
npm ERR!
npm ERR! info it worked if it ends with ok
npm ERR! gyp
npm ERR! info using
npm ERR! node-gyp#8.4.1
npm ERR! gyp
npm ERR! info using
npm ERR! node#16.11.1 | linux | x64
npm ERR! gyp
npm ERR! info ok
npm ERR! gyp
npm ERR!
npm ERR! info
npm ERR!
npm ERR! it worked if it ends with
npm ERR! ok
npm ERR! gyp
npm ERR!
npm ERR! info
npm ERR!
npm ERR! using
npm ERR! node-gyp#8.4.1
npm ERR! gyp
npm ERR!
npm ERR! info
npm ERR!
npm ERR! using
npm ERR! node#16.11.1 | linux | x64
npm ERR! gyp
npm ERR! info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp
npm ERR! info spawn /usr/bin/python3
npm ERR! gyp
npm ERR! 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
npm ERR! spawn args '-f',
npm ERR! gyp info
npm ERR! spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp
npm ERR! info spawn args '/home/info/Fab/node_modules/nodegit/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info
npm ERR! spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp
npm ERR! info spawn args '/root/.cache/node-gyp/16.11.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp
npm ERR! info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.11.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info
npm ERR! spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.11.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/info/Fab/node_modules/nodegit',
npm ERR! gyp
npm ERR! info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp
npm ERR! info spawn args '--no-parallel',
npm ERR! gyp info
npm ERR! spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp
npm ERR! info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args
npm ERR! ]
npm ERR! /bin/sh: 1: krb5-config: not found
npm ERR! gyp: Call to 'krb5-config gssapi --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 4.19.0-17-cloud-amd64
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/info/Fab/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/home/info/Fab/node_modules/nodegit/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /home/info/Fab/node_modules/nodegit
npm ERR! gyp ERR! node -v v16.11.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
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 configure --fallback-to-build --module=/home/info/Fab/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/home/info/Fab/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/info/Fab/node_modules/#discordjs/node-pre-gyp/lib/util/compile.js:72:20)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064: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 4.19.0-17-cloud-amd64
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/home/info/Fab/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/info/Fab/node_modules/nodegit
npm ERR! node-pre-gyp ERR! node -v v16.11.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.1.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! [nodegit] ERROR - Could not finish install
npm ERR! [nodegit] ERROR - finished with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-12-07T16_43_17_819Z-debug-0.log

Related

Problems installing argon2 in a project with npm

I'm having some issue's installing argon2 npm package in my project. I am a bit of a beginner and have tried to check everything:
To start this is my system:
MacBook Air m1 6 months old
Python
3.10.2
Clang
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Make
GNU Make 3.81
This program built for i386-apple-darwin11.3.0
Installed:
sudo npm install -g node-gyp
within the package but globally
If I go inside the node-gyp folder:
node-gyp#9.0.0 /usr/local/lib/node_modules/node-gyp
node#17.6.0
So it looks like I have everything to get it running.
After the command for argon2:
npm i argon2
npm ERR! code 1
npm ERR! path /Users/billy/Wild Code School/Express/MVC_architecture/Express-----
Quests/node_modules/argon2
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/ref.o
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/core.o
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/thread.o
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
npm ERR! LIBTOOL-STATIC Release/argon2.a
npm ERR! CXX(target) Release/obj.target/argon2/src/argon2_node.o
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=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3/argon2.node --module_name=argon2 --module_path=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3 --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#1.0.9
npm ERR! node-pre-gyp info using node#17.6.0 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3/argon2.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/ranisalt/node-
argon2/releases/download/v0.28.5/argon2-v0.28.5-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on
https://github.com/ranisalt/node-argon2/releases/download/v0.28.5/argon2-v0.28.5-
napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for argon2#0.28.5 and
node#17.6.0 (node-v102 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on
https://github.com/ranisalt/node-argon2/releases/download/v0.28.5/argon2-v0.28.5-
napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.4.1
npm ERR! gyp info using node#17.6.0 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.4.1
npm ERR! gyp info using node#17.6.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.2 found at
"/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
npm ERR! gyp info spawn
/Library/Frameworks/Python.framework/Versions/3.10/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 '/Users/billy/Wild Code
School/Express/MVC_architecture/Express-
Quests/node_modules/argon2/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 '/Users/billy/Library/Caches/node-
gyp/17.6.0/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=/Users/billy/Library/Caches/node-
gyp/17.6.0',
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=/Users/billy/Library/Caches/node-
gyp/17.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2',
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#8.4.1
npm ERR! gyp info using node#17.6.0 | darwin | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! clang: error: no such file or directory: 'Code'
npm ERR! clang: error: no such file or directory:
'School/Express/MVC_architecture/Express-Quests/node_modules/node-addon-api'
npm ERR! make: *** [Release/obj.target/argon2/src/argon2_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
(/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:527:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit
(node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.5.0
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=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3/argon2.node" "--module_name=argon2" "--module_path=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--
node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2
npm ERR! gyp ERR! node -v v17.6.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
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=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3/argon2.node --module_name=argon2 --module_path=/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2/lib/binding/napi-
v3 --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> (/Users/billy/Wild
Code School/Express/MVC_architecture/Express-Quests/node_modules/#mapbox/node-pre-
gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose
(node:internal/child_process:1090:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit
(node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 21.5.0
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/.bin/node-pre-gyp"
"install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/billy/Wild Code
School/Express/MVC_architecture/Express-Quests/node_modules/argon2
npm ERR! node-pre-gyp ERR! node -v v17.6.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/billy/.npm/_logs/2022-06-10T13_25_52_362Z-debug-0.log

npm install stuck on reify grpc

I got this error after I run "npm install". The warning only appear on the connection part for my chatbot and dialogflow. I try to downgrade my node version by using node 10 and also node 12, but the error still persist.The error state that to use grpc/grpc-js instead of grpc#1.24.11, but I didn't have grpc#1.24.11 on my package file. My node and my npm version is on the code that I provide. Thanks in advance. Here is the error:
npm WARN EBADENGINE package: undefined,
npm WARN EBADENGINE required: { node: '10' },
npm WARN EBADENGINE current: { node: 'v17.8.0', npm: '8.5.5' }
npm WARN EBADENGINE }
npm WARN deprecated grpc#1.24.11: This library will not receive further updates other than security fixes. We recommend using #grpc/grpc-js instead.
npm ERR! code 1
npm ERR! path /home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! make: Entering directory '/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/build'
This is the error it gave after it try to reify grpc
npm ERR! make: Leaving directory '/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/build'
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (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.9
npm ERR! node-pre-gyp info using node#17.8.0 | linux | x64
npm ERR! node-pre-gyp info check checked for "/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc/grpc_node.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.24.11/node-v102-linux-x64-glibc.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc/v1.24.11/node-v102-linux-x64-glibc.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for grpc#1.24.11 and node#17.8.0 (node-v102 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc/v1.24.11/node-v102-linux-x64-glibc.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#17.8.0 | linux | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#17.8.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.4 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 '/usr/lib/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/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/zakwan/.cache/node-gyp/17.8.0/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/zakwan/.cache/node-gyp/17.8.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/zakwan/.cache/node-gyp/17.8.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc',
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.0.0
npm ERR! gyp info using node#17.8.0 | linux | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In function ‘Slice sub_no_ref(const Slice&, size_t, size_t) [with Slice = grpc_slice]’,
npm ERR! inlined from ‘grpc_slice grpc_slice_sub_no_ref(grpc_slice, size_t, size_t)’ at ../deps/grpc/src/core/lib/slice/slice.cc:344:20,
npm ERR! inlined from ‘grpc_slice grpc_slice_sub(grpc_slice, size_t, size_t)’ at ../deps/grpc/src/core/lib/slice/slice.cc:361:35:
npm ERR! ../deps/grpc/src/core/lib/slice/slice.cc:337:11: warning: ‘void* memcpy(void*, const void*, size_t)’ forming offset 32 is out of the bounds [0, 32] of object ‘<anonymous>’ with type ‘grpc_slice’ [-Warray-bounds]
npm ERR! 337 | memcpy(subset.data.inlined.bytes, source.data.inlined.bytes + begin,
npm ERR! | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! 338 | end - begin);
npm ERR! | ~~~~~~~~~~~~
npm ERR! ../deps/grpc/src/core/lib/slice/slice.cc: In function ‘grpc_slice grpc_slice_sub(grpc_slice, size_t, size_t)’:
npm ERR! ../deps/grpc/src/core/lib/slice/slice.cc:352:12: note: ‘<anonymous>’ declared here
npm ERR! 352 | grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) {
npm ERR! | ^~~~~~~~~~~~~~
npm ERR! In file included from /home/zakwan/.cache/node-gyp/17.8.0/include/node/openssl/rsa.h:14,
npm ERR! from ../deps/grpc/src/core/lib/security/credentials/jwt/json_token.h:27,
npm ERR! from ../deps/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h:25,
npm ERR! from ../deps/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc:41:
npm ERR! /home/zakwan/.cache/node-gyp/17.8.0/include/node/openssl/macros.h:155:4: error: #error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
npm ERR! 155 | # error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
npm ERR! | ^~~~~
npm ERR! make: *** [grpc.target.mk:546: Release/obj.target/grpc/deps/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.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/lib/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.17.1-zen1-1-zen
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
npm ERR! gyp ERR! cwd /home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc
npm ERR! gyp ERR! node -v v17.8.0
npm ERR! gyp ERR! node-gyp -v v9.0.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 '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc/src/node/extension_binary/node-v102-linux-x64-glibc --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/#mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1090:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.17.1-zen1-1-zen
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd /home/zakwan/Documents/WORK/Project/Chatbot/hospitalX_chatbot/connectchat/functions/node_modules/grpc
npm ERR! node-pre-gyp ERR! node -v v17.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /home/zakwan/.npm/_logs/2022-04-05T05_43_46_347Z-debug-0.log```
I found answer here link. Use #grpc/grpc-js instead grpc in your package.json file.
I encountered same issue, problem was python was not installed in my machine, So I installed python and issue was fixed

Angular build fails with command sh -c node-pre-gyp install --fallback-to-build --library=static_library

I don't really know why, but when i build my app using my ci/cd on Gitlab it fails with the error stack hereinafter.
On my computer i don't have an npm install issue.
Locally I have node: 16.13.2 and npm 8.1.2
On Gitlab for the ci/cd the image we use has node: 'v16.13.1' and npm: '8.1.3'
npm ERR! code 1
npm ERR! path /builds/gara-project/gara-front-end/gara-console/node_modules/grpc
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (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.14.0
npm ERR! node-pre-gyp info using node#16.13.1 | linux | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.1 | linux | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/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 '/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.13.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=/root/.cache/node-gyp/16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.13.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc',
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#8.3.0
npm ERR! gyp info using node#16.13.1 | linux | x64
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: not found: make
npm ERR! gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:10:17)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:57:18
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at step (/usr/lib/node_modules/npm/node_modules/which/which.js:54:21)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:71:22
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at subStep (/usr/lib/node_modules/npm/node_modules/which/which.js:69:33)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:80:22
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! System Linux 5.4.109+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /builds/gara-project/gara-front-end/gara-console/node_modules/grpc
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v8.3.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 '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-musl --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064: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.109+
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/builds/gara-project/gara-front-end/gara-console/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd /builds/gara-project/gara-front-end/gara-console/node_modules/grpc
npm ERR! node-pre-gyp ERR! node -v v16.13.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-03-25T15_43_04_463Z-debug.log
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
I tried a lot of solutions found on internet npm install --build-from-source or add it in package.json but most of them seems not working

how to fix npm install sqlite3 error on mac?

I'm trying to install sqlite3 with npm on mac however the following error follows
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
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 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 /Users/ryan/Desktop/12SDE/Formative-1/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/ryan/Desktop/12SDE/Formative-1/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/ryan/Desktop/12SDE/Formative-1/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)
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.13.1 | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.1 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.1 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.0 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/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 '/Users/ryan/Desktop/12SDE/Formative-1/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 '/Users/ryan/Library/Caches/node-gyp/16.13.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=/Users/ryan/Library/Caches/node-gyp/16.13.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=/Users/ryan/Library/Caches/node-gyp/16.13.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/ryan/Desktop/12SDE/Formative-1/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! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
npm ERR!
npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
npm ERR!
npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
npm ERR!
npm ERR! Traceback (most recent call last):
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1502, in XcodeVersion
npm ERR! version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1563, in GetStdoutQuiet
npm ERR! raise GypError("Error %d running %s" % (job.returncode, cmdlist[0]))
npm ERR! gyp.common.GypError: Error 1 running xcodebuild
npm ERR!
npm ERR! During handling of the above exception, another exception occurred:
npm ERR!
npm ERR! Traceback (most recent call last):
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 45, in <module>
npm ERR! sys.exit(gyp.script_main())
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 662, in script_main
npm ERR! return main(sys.argv[1:])
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 654, in main
npm ERR! return gyp_main(args)
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 639, in gyp_main
npm ERR! generator.GenerateOutput(flat_list, targets, data, params)
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2455, in GenerateOutput
npm ERR! writer.Write(
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 798, in Write
npm ERR! self.WriteActions(
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 932, in WriteActions
npm ERR! env = self.GetSortedXcodeEnv()
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2108, in GetSortedXcodeEnv
npm ERR! return gyp.xcode_emulation.GetSortedXcodeEnv(
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1888, in GetSortedXcodeEnv
npm ERR! env = _GetXcodeEnv(
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1743, in _GetXcodeEnv
npm ERR! "XCODE_VERSION_ACTUAL": XcodeVersion()[0],
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1513, in XcodeVersion
npm ERR! version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1551, in CLTVersion
npm ERR! return re.search(regex, output).groupdict()["version"]
npm ERR! AttributeError: 'NoneType' object has no attribute 'groupdict'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/ryana/Desktop/12SDE/Formative-1/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/ryan/Desktop/12SDE/Formative-1/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"
npm ERR! gyp ERR! cwd /Users/ryan/Desktop/12SDE/Formative-1/node_modules/sqlite3
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v8.3.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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/ryan/Desktop/12SDE/Formative-1/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/ryan/Desktop/12SDE/Formative-1/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)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/ryan/Desktop/12SDE/Formative-1/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064: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 Darwin 20.6.0
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/ryan/Desktop/12SDE/Formative-1/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/ryan/Desktop/12SDE/Formative-1/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v16.13.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! /Users/ryan/.npm/_logs/2021-12-02T07_55_52_766Z-debug.log
I am not really sure what to do as it pushes me to download an xcode developers thing. Must i download it or is there a solution to resolve this error.
node version v16.13.1
npm version 8.1.2
command used npm install sqlite3
sqlite3 version 3.32.3
In npm there seems to be no version 3.32.3.
The npm versioning is not the same as the version of the sqlite3.
But I get similar errors if I try to install any 3.x.x version via npm.
But I was also able to install sqlite3#4.2.0 aswell as sqlite#5.0.2 via npm.
Here you can find the version history for the sqlite3 npm package
Edit:
The current version of the npm sqlite3 package (Time of writing 5.0.2) will ship sqlite 3.32.3 internaly if you do not have sqlite3 installed on your system!
Maybe you have to clean your npm cache or uninstall you local sqlite3 version in order to be able to install the sqlite3 package from npm?

npm installation sqlite3 error on Ubuntu Server

I've a problem.
I made a bot on Windows with the module Discord.js and now, i want to run it on my Raspberry Pi 4. My application needs sqlite3 but when i do npm install (even with sudo) to install all my packages, it returns this (i'm not comfortable with Nodejs errors) :
$ sudo npm install
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 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 ERR! code 1
npm ERR! path /home/ubuntu/project/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64 --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 | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64/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-arm64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-arm64.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-arm64.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-arm64.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 | arm64
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 | arm64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/bin/python3"
npm ERR! (node:62288) [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/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/ubuntu/project/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/ubuntu/.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/ubuntu/.cache/node-gyp/16.6.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/16.6.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/ubuntu/project/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 | arm64
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: not found: make
npm ERR! gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:10:17)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:57:18
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at step (/usr/lib/node_modules/npm/node_modules/which/which.js:54:21)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:71:22
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at subStep (/usr/lib/node_modules/npm/node_modules/which/which.js:69:33)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:80:22
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! System Linux 5.11.0-1007-raspi
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /home/ubuntu/project/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/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/ubuntu/project/node_modules/sqlite3/lib/binding/napi-v3-linux-arm64 --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/ubuntu/project/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.11.0-1007-raspi
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/ubuntu/project/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/ubuntu/project/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/ubuntu/.npm/_logs/2021-08-10T08_46_29_583Z-debug.log
my package.json
{
"name": "project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^12.5.3",
"sqlite3": "^5.0.2"
},
"scripts": {
"test": "node ."
}
}
NB
$ node -v
v16.6.1
$ npm -v
7.20.3
$ python --version
Python 3.9.5
Can you help me?

Resources