justadudewhohacks / opencv4nodejs

Nodejs bindings to OpenCV 3 and OpenCV 4
MIT License
4.96k stars 827 forks source link

Solved installing on Windows #847

Open opencv4nodejs opened 2 years ago

opencv4nodejs commented 2 years ago

I could not install opencv4nodejs on Windows 11 with node 16, npm 8, and Visual Studio 2019 build tools.

I downgraded to node 14 and npm 6.

I had Visual Studio 2017 build tools installed with 2019, but the installation looked from 15.0 in the 2019 folder.

I uninstalled 2019 tools, repaired 2017 from the VS Installer, and successfully installed openvs4nodejs from Developer Command Prompt for VS 2017.

I found this https://github.com/justadudewhohacks/opencv4nodejs/issues/717 alternative to uninstalling 2019.

info install failed to find auto-build.json: C:\Users\skele\Documents\apps\voice\socket\node_modules\opencv-build\opencv\auto-build.json
info install
info install running install script...
info install
info install opencv version: 3.4.6
info install with opencv contrib: yes
info install custom build flags:
info install
info install executing: git --version
info install git --version: git version 2.36.0.windows.1
info install
info install executing: cmake --version
info install cmake --version: cmake version 3.12.18081601-MSVC_2
info install
info install CMake suite maintained and supported by Kitware (kitware.com/cmake).
info install
info install using msbuild: {
info install   path: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe',
info install   version: 15
info install }

npm ERR! opencv-build@0.1.9 install: `node ./install.js`
UrielCh commented 2 years ago

please try using @u4/opencv4nodejs this version will be merged to opencv4nodejs soon. but for that, we need more feedback.

Jaid commented 2 years ago

@UrielCh, thank you very much for working on your fork. Using @u4/opencv4nodejs and @u4/opencv-build solved all my setup problems on Windows.

UrielCh commented 2 years ago

Hi, Great news for those people that do not want to build their OpenCV: I published @u4/opencv4nodejs V 6.2.4 today,

This version autodetects the common setup path for Brew on Mac, Chocolatey on Windows, and Apt on Linux.

just define environment variable: OPENCV4NODEJS_DISABLE_AUTOBUILD=1

And your prebuild OpenCV will be used.

You may need to call: npx build-opencv rebuild or npx build-opencv --nobuild rebuild (if you do not define OPENCV4NODEJS_DISABLE_AUTOBUILD variable)

robtoll commented 1 year ago

thanks this helped a lot

Qwqw127 commented 1 month ago

Hi, Great news for those people that do not want to build their OpenCV: I published @u4/opencv4nodejs V 6.2.4 today,

This version autodetects the common setup path for Brew on Mac, Chocolatey on Windows, and Apt on Linux.

  • Windows:

choco install opencv

  • Mac:

brew install opencv

  • debian:

apt -y install libopencv-contrib-dev libopencv-dev

just define environment variable: OPENCV4NODEJS_DISABLE_AUTOBUILD=1

And your prebuild OpenCV will be used.

You may need to call: npx build-opencv rebuild or npx build-opencv --nobuild rebuild (if you do not define OPENCV4NODEJS_DISABLE_AUTOBUILD variable)

image

Idealyy commented 1 month ago

please try using @u4/opencv4nodejs this version will be merged to opencv4nodejs soon. but for that, we need more feedback.

Hi i'm having issues while installing u4/opencv4nodejs on windows 11.