I am trying to install opencv for vehicle detection in realtime. While installing opencv in terminal it always fail to install
Parameshs-MacBook-Air:pyrky_nodejs parameshv$ npm install opencv --save
opencv#6.0.0 install /Users/parameshv/pyrky_nodejs/node_modules/opencv
node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for opencv#6.0.0 and node#10.8.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for opencv#6.0.0 and node#10.8.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
CXX(target) Release/obj.target/opencv/src/init.o
CXX(target) Release/obj.target/opencv/src/init.o
sed: ./Release/.deps/Release/obj.target/opencv/src/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/opencv/src/init.o] Error 1
CXX(target) Release/obj.target/opencv/src/Matrix.o
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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.8.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64/opencv.node" "--module_name=opencv" "--module_path=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64"
gyp ERR! cwd /Users/parameshv/pyrky_nodejs/node_modules/opencv
gyp ERR! node -v v10.8.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.8.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64/opencv.node --module_name=opencv --module_path=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/parameshv/pyrky_nodejs/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:249:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.8.0/bin/node" "/Users/parameshv/pyrky_nodejs/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/parameshv/pyrky_nodejs/node_modules/opencv
node-pre-gyp ERR! node -v v10.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.8.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64/opencv.node --module_name=opencv --module_path=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64' (1)
npm WARN opencv#6.0.0 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm WARN pyrky#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv#6.0.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv#6.0.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/parameshv/.npm/_logs/2018-09-04T05_34_09_181Z-debug.log
Parameshs-MacBook-Air:pyrky_nodejs parameshv$
Parameshs-MacBook-Air:pyrky_nodejs parameshv$
Parameshs-MacBook-Air:pyrky_nodejs parameshv$ ../src/Matrix.cc:2:10: fatal error: 'Matrix.h' file not found
include "Matrix.h"
^~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/opencv/src/Matrix.o] Error 1
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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.8.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64/opencv.node" "--module_name=opencv" "--module_path=/Users/parameshv/pyrky_nodejs/node_modules/opencv/build/opencv/v6.0.0/Release/node-v64-darwin-x64"
gyp ERR! cwd /Users/parameshv/pyrky_nodejs/node_modules/opencv
gyp ERR! node -v v10.8.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Tried to fix this installing
brew tap brewsci/science
brew install pkg-config opencv#2
brew link opencv#2 --force
npm install opencv --save
How to install opencv npm in mac os? Any help much appreciates pls....
Related
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
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
I get a similar error to a whole lot of other stack threads. However after trying many of the suggested solutions I am still stuck. I am running
npm install
in a cloned git project folder when trying to run an angular application. This yields the following error:
> grpc#1.10.1 install /Users/my_usrname/my_project/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.10.1 and node#10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc#1.10.1 and node#10.15.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
rm: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
gyp CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/my_usrname/.nvm/versions/node/v10.15.3/bin/node" "/Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/my_usrname/my_project-master/node_modules/grpc
gyp ERR! node -v v10.15.3
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/my_usrname/.nvm/versions/node/v10.15.3/bin/node /Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/my_usrname/my_project-master/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/Users/my_usrname/.nvm/versions/node/v10.15.3/bin/node" "/Users/my_usrname/my_project-master/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/my_usrname/my_project-master/node_modules/grpc
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/my_usrname/.nvm/versions/node/v10.15.3/bin/node /Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oe
../deps/grpc/src/core/lib/backoff/backoff.cc:23:10: fatal error: l: Failed to e
'src/core/lib/gpr/useful.h' file not found
#include "src/core/lib/gpr/useful.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/my_usrname/.nvm/versions/node/v10.15.3/bin/node" "/Users/my_usrname/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/myusrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/my_usrname/my_project-master/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/my_usrname/my_project-master/node_modules/grpc
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN #angular/flex-layout#2.0.0-beta.12 requires a peer of #angular/core#~5.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/flex-layout#2.0.0-beta.12 requires a peer of #angular/common#~5.1.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.10.1 install: `node-pre-gyp install --fallback-to-build -- <pre><code>library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.10.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/my_usrname/.npm/_logs/2019-03-21T19_25_09_711Z-debug.log
I have node version v10.15.3, npm verison 6.9.0.
About angular:
Angular CLI: 1.7.4
Node: 10.15.3
OS: darwin x64
Angular: 5.2.4
I have tried uninstalling node, restarting computer and reinstalling node as some have suggested. Installed node-gyp globaly as I found in another answer.
I am able to run this angular application however, from following angular quick start at https://angular.io/guide/quickstart
There are two main issues here. First, grpc#1.10.1 is a fairly old version of the library, and it does not have support for Node 10, which is newer. If you are explicitly depending on that version of grpc or one of your dependencies is, you should try to update the dependency or get your dependency to do so. Alternatively, I believe that version of grpc supports Node 8, so you can downgrade your Node version to get it working.
Second, I am guessing from the mention of Angular that your are going to want to run this on a browser client. That will not work; grpc simply does not work on browsers. If you are using grpc directly you may be able to use grpc-web instead on the browser.
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
I've found other issues regarding fallback to binary build for other node packages but none for Realm. I've tried some solutions from other scenarios such as:
removing /home/.node-gyp,
installing build-essential / installing libkrb5-dev,
removing node_modulesfrom project root and node-gyp and then doing a fresh npm install
Yet when I run npm install --save realm I get this error trace:
node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/realm-v1.2.0-node-v51-linux-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm#1.2.0 and node#7.5.0 (node-v51 ABI) (falling back to source compile with node-gyp)
make: Entering directory `/home/..../node_modules/realm/build'
ACTION binding_gyp_vendored_realm_target_download_realm /home/..../node_modules/realm/vendor/realm-node
Downloading dependency: realm-node 2.4.0
Using cached realm-node from TMPDIR
Skipping the sync download because ENABLE_SYNC is false.
TOUCH Release/obj.target/vendored-realm.stamp
TOUCH Release/obj.target/realm-core.stamp
CXX(target) Release/obj.target/object-store/src/object-store/src/binding_callback_thread_observer.o
g++: error: unrecognized command line option ‘-std=c++14’
make: *** [Release/obj.target/object-store/src/object-store/src/binding_callback_thread_observer.o] Error 1
make: Leaving directory `/home/..../node_modules/realm/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:285:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:192:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-75-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/./node_modules/realm/compiled/node-v51_linux_ia32/realm.node" "--module_name=realm" "--module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32"
gyp ERR! cwd /home/..../node_modules/realm
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.6.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=/home/..../node_modules/realm/compiled/node-v51_linux_ia32/realm.node --module_name=realm --module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/..../node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:192:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:890:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-75-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/..../node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/..../node_modules/realm
node-pre-gyp ERR! node -v v7.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.34
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=/home/..../node_modules/realm/compiled/node-v51_linux_ia32/realm.node --module_name=realm --module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! realm#1.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the realm#1.2.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the realm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
I am using node version 7.5.0 and npm version 4.5.0.
I have the node-pre-gyp package.
What is going on?!
Try the following step by step,
Install the older version in the project folder
npm install --save realm#0.14.3
Open node_modules/realm/package.json and remove this line:
"postlink": "node_modules/realm/scripts/rnpm-postlink.js"
Link
react-native link realm
The solution was found here