UrielCh / opencv4nodejs

ESM Nodejs bindings to OpenCV 3/4
MIT License
254 stars 51 forks source link

Error when installing #147

Open stoefln opened 5 months ago

stoefln commented 5 months ago

I just tried to install the module for my electron v16 project.

I get this:

npm ERR! code 1
npm ERR! path /Users/steph/Workspace/repeato-studio/node_modules/@u4/opencv4nodejs
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR!
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.1.0
npm ERR! gyp info using node@16.13.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.4 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/steph/Workspace/repeato-studio/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/steph/Workspace/repeato-studio/node_modules/@u4/opencv4nodejs/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/steph/Workspace/repeato-studio/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/steph/Library/Caches/node-gyp/16.13.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/steph/Library/Caches/node-gyp/16.13.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/steph/Workspace/repeato-studio/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/steph/Library/Caches/node-gyp/16.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/steph/Workspace/repeato-studio/node_modules/@u4/opencv4nodejs',
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: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 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.<anonymous> (/Users/steph/Workspace/repeato-studio/node_modules/node-gyp/lib/configure.js:297:18)
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 23.1.0
npm ERR! gyp ERR! command "/Users/steph/.nvm/versions/node/v16.13.0/bin/node" "/Users/steph/Workspace/repeato-studio/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/steph/Workspace/repeato-studio/node_modules/@u4/opencv4nodejs
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v10.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/steph/.npm/_logs/2024-06-28T10_30_25_414Z-debug.log

Any ideas?

liftyourgame commented 4 months ago

Try node 20?

OkFrog97 commented 4 months ago

I have same problem. WSL Ubuntu 22.04. " 1055 error gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp 1055 error gyp ERR! configure error ... 1055 error gyp ERR! node -v v20.15.1 1055 error gyp ERR! node-gyp -v v10.2.0 1055 error gyp ERR! not ok "

HassanAlti commented 3 months ago

Same error here, WSL Ubuntu 22.04, and node -v 20.17.0

HassanAlti commented 3 months ago

Same error here, WSL Ubuntu 22.04, and node -v 20.17.0

Fixed by doing OPENCV4NODEJS_DISABLE_AUTOBUILD=1 pnpm install @u4/opencv4nodejs

Took about 15 mins to install

GreatHongyu commented 2 months ago

OPENCV4NODEJS_DISABLE_AUTOBUILD=1 pnpm install @u4/opencv4nodejs not work for me, windows10