how can I fix npm install sqlite3 fail? - node.js

I am using windows sub linux (ubuntu) for my project and tried to install sqlite3 using npm install sqlite3
Here is my error:
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> sqlite3#5.0.1 install /mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
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.1/napi-v6-linux-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3#5.0.1 and node#14.15.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/build'
make: Warning: File 'Makefile' has modification time 0.00041 s in the future
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
AR(target) Release/obj.target/../node-addon-api/nothing.a
COPY Release/nothing.a
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3320300/sqlite3.c
/bin/sh: 1: python: not found
make: *** [deps/action_before_build.target.mk:13: Release/obj/gen/sqlite-autoconf-3320300/sqlite3.c] Error 127
make: Leaving directory '/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.128-microsoft-standard
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=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6"
gyp ERR! cwd /mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3
gyp ERR! node -v v14.15.1
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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Linux 4.19.128-microsoft-standard
node-pre-gyp ERR! command "/usr/local/bin/node" "/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.15.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
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=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/mnt/c/Users/window/Documents/IEEE-Website/backend/node_modules/sqlite3/lib/binding/napi-v6-linux-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3#5.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3#5.0.1 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! /home/rkim964/.npm/_logs/2021-02-05T00_40_18_352Z-debug.log
Is there any idea I can fix this?
I have tried to delete package-lock.json and node_module and did npm install again but doesn't work for me.
Addition to this I have run node-pre-gyp install --fallback-to-build
the result was
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp#0.10.2
node-pre-gyp info using node#10.19.0 | linux | x64
node-pre-gyp info build requesting source compile
gyp info it worked if it ends with ok
gyp info using node-gyp#6.1.0
gyp info using node#10.19.0 | linux | x64
gyp info ok
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: backend package.json is not node-pre-gyp ready:
node-pre-gyp ERR! stack package.json must declare these properties:
node-pre-gyp ERR! stack main
node-pre-gyp ERR! stack binary.module_name
node-pre-gyp ERR! stack binary.module_path
node-pre-gyp ERR! stack binary.host
node-pre-gyp ERR! stack at validate_config (/usr/lib/nodejs/node-pre-gyp/lib/util/versioning.js:220:15)
node-pre-gyp ERR! stack at Object.module.exports.evaluate (/usr/lib/nodejs/node-pre-gyp/lib/util/versioning.js:279:5)
node-pre-gyp ERR! stack at handle_gyp_opts (/usr/lib/nodejs/node-pre-gyp/lib/util/handle_gyp_opts.js:59:27)
node-pre-gyp ERR! stack at configure (/usr/lib/nodejs/node-pre-gyp/lib/configure.js:12:5)
node-pre-gyp ERR! stack at /usr/lib/nodejs/node-pre-gyp/lib/build.js:43:13
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/nodejs/node-pre-gyp/lib/util/compile.js:85:9)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.19.128-microsoft-standard
node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /mnt/c/Users/window/Documents/IEEE-Website/backend
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues>
This is what I have got

i actually found the solution. It is sudo apt-get install python-is-python3. As ubuntu devide python as python2 and python3 command so you need map the python to python3 which sudo apt-get install python-is-python3 does it for ubuntu user

Related

npm ERR I can't install npm m1 MacBook

the code is here its for generate 10,000 NFT gethub link (https://github.com/codeSTACKr/video-source-code-create-nft-collection.git)
I installed NodeJs. on my m1 Mac and every time I try to install npm inside the VsCode I get this error I'm new to programing idk how can fix it I've been struggling for 2 weeks now
video-source-code-create-nft-collection % npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json was generated for lockfileVersion#2. I'll try to do my best with it!
canvas#2.8.0 install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas#2.8.0 and node#14.18.2 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing pixman-1.pc' to the PKG_CONFIG_PATH environment variable No package 'pixman-1' found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
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 21.2.0
gyp ERR! command "/opt/homebrew/Cellar/node#14/14.18.2/bin/node" "/opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
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 '/opt/homebrew/Cellar/node#14/14.18.2/bin/node /opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/ahmed/video-source-code-create-nft-collection/node_modules/#mapbox/node-pre-gyp/lib/util/compile.js:89:23)
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 21.2.0
node-pre-gyp ERR! command "/opt/homebrew/Cellar/node#14/14.18.2/bin/node" "/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
node-pre-gyp ERR! node -v v14.18.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.6
node-pre-gyp ERR! not ok
ahmed#Ahmeds-MacBook-Pro video-source-code-create-nft-collection % npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json was generated for lockfileVersion#2. I'll try to do my best with it!
canvas#2.8.0 install /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas#2.8.0 and node#14.18.2 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-darwin-unknown-arm64.tar.gz
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing pixman-1.pc' to the PKG_CONFIG_PATH environment variable No package 'pixman-1' found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
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 21.2.0
gyp ERR! command "/opt/homebrew/Cellar/node#14/14.18.2/bin/node" "/opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
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 '/opt/homebrew/Cellar/node#14/14.18.2/bin/node /opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/ahmed/video-source-code-create-nft-collection/node_modules/#mapbox/node-pre-gyp/lib/util/compile.js:89:23)
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 21.2.0
node-pre-gyp ERR! command "/opt/homebrew/Cellar/node#14/14.18.2/bin/node" "/Users/ahmed/video-source-code-create-nft-collection/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas
node-pre-gyp ERR! node -v v14.18.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.6
node-pre-gyp ERR! not ok
Failed to execute '/opt/homebrew/Cellar/node#14/14.18.2/bin/node /opt/homebrew/Cellar/node#14/14.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/ahmed/video-source-code-create-nft-collection/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN hashlips_art_engine#1.1.1 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas#2.8.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#2.8.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/ahmed/.npm/_logs/2021-12-14T00_37_55_725Z-debug.log
before install npm in vs code try:
nvm install
then
npm install
and try change node ver 14 before all of this

node-pre-gyp install --fallback-to-build html-to-docx

Does anyone know what is causing this error?
Only seems to be when I try to install this html-to-docx package, all others are fine.
I've already tried adding gyp manually to package.json, downgrading node.js with nvm as well as installing with the --build-from-source flag.
Output below:
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(404): https://github.com/gagern/node-libtidy/releases/download/v0.4.1/node-v72-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for libtidy-updated#0.4.1 and node#12.18.3 (node-v72 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
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/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib/tidy.node" "--module_name=tidy" "--module_path=/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated
gyp ERR! node -v v12.18.3
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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib/tidy.node --module_name=tidy --module_path=/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated
node-pre-gyp ERR! node -v v12.18.3
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
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/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib/tidy.node --module_name=tidy --module_path=/Users/antnewman/Desktop/Projects/doc-translator/node_modules/libtidy-updated/lib --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN document-translator#1.0.0 No description
npm WARN document-translator#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libtidy-updated#0.4.1 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libtidy-updated#0.4.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Firebase installation error with "Pre-built binaries not found for grpc#1.19.0 and node#12.1.0"

I am trying to install firebase on my MacBook, and is getting the following error.
$ npm install -g firebase
> grpc#1.19.0 install /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.19.0/node-v72-darwin-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for grpc#1.19.0 and node#12.1.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:304:12)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at maybeClose (internal/child_process.js:1000:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node" "/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:196:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1000:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
node-pre-gyp ERR! System Darwin 18.5.0
node-pre-gyp ERR! command "/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node" "/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc
node-pre-gyp ERR! node -v v12.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/satoshi/.nvm/versions/node/v12.1.0/bin/node /Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/satoshi/.nvm/versions/node/v12.1.0/lib/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.19.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.19.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/satoshi/.npm/_logs/2019-04-30T20_15_40_148Z-debug.log
I have npm (6.9.0) and node (12.1.0). It looks like a type of version mismatch, but I am not able to find out how to fix this issue.
The problem here is that grpc 1.19.0 is not compatible with Node 12. Version 1.20.2 of grpc is compatible with Node 12, so if Firebase updates their dependency that will also fix the problem.
This work for me:
install nvm from https://github.com/nvm-sh/nvm
switch to node version : v10.15.3

npm install fails on ubuntu 18.04 with error : "Failed at the bcrypt#3.0.3 install script"

I get below error while setting up a nodejs project on Ubuntu 18.04. The npm version installed is 6.x and the node version installed is 10.x.
I searched for the fixes here and here on SO but did not get any appropriate fix.
bcrypt#3.0.3 install /home/ubuntu/reko_dev/web/backend/node_modules/bcrypt
> 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(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt#3.0.3 and node#10.15.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.15.0-1021-aws
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/reko_dev/web/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/ubuntu/reko_dev/web/backend/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /home/ubuntu/reko_dev/web/backend/node_modules/bcrypt
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
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/reko_dev/web/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ubuntu/reko_dev/web/backend/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/ubuntu/reko_dev/web/backend/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Linux 4.15.0-1021-aws
node-pre-gyp ERR! command "/usr/bin/node" "/home/ubuntu/reko_dev/web/backend/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ubuntu/reko_dev/web/backend/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.15.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
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/reko_dev/web/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ubuntu/reko_dev/web/backend/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN mongoose-auto-increment#5.0.1 requires a peer of mongoose#^4.1.12 but none is installed. You must install peer dependencies yourself.
npm WARN rekogapiserver#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#3.0.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#3.0.3 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! /home/ubuntu/.npm/_logs/2019-01-08T17_09_19_086Z-debug.log
As #tkausl mentioned, looks like make isn’t installed.
sudo apt-get update
sudo apt-get install build-essential

How to debug Node 8 app?

My node inspector failed after I upgraded to Node 8. It was working on Node 6. I am using MacOS. What is the best way to debug node 8 app? I tried to re-install node inspector again, then got the following error msg:
➜ ~ sudo npm install -g node-inspector
> v8-profiler#5.7.0 preinstall /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler
> node -e 'process.exit(0)'
> v8-debug#1.0.1 preinstall /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
> node -e 'process.exit(0)'
/usr/local/bin/node-inspector -> /usr/local/lib/node_modules/node-inspector/bin/inspector.js
/usr/local/bin/node-debug -> /usr/local/lib/node_modules/node-inspector/bin/node-debug.js
> v8-debug#1.0.1 install /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(undefined): https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug#1.0.1 and node#8.3.0 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug#1.0.1 and node#8.3.0 (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build'
gyp ERR! System Darwin 16.7.0
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=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64/debug.node" "--module_name=debug" "--module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
gyp ERR! node -v v8.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
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=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64/debug.node --module_name=debug --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/node-inspector/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-inspector/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
node-pre-gyp ERR! node -v v8.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
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=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64/debug.node --module_name=debug --module_path=/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v1.0.1/node-v57-darwin-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! v8-debug#1.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug#1.0.1 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/shenxinxu/.npm/_logs/2017-08-16T14_32_27_981Z-debug.log

Resources