Не удалось установить opencv4 nodejs на Windows7 - PullRequest
0 голосов
/ 06 августа 2020

Привет, я пытаюсь использовать opencv в своем проекте. Я пытался установить с помощью cnpm, но получил ошибки. Я уже установил cmake и windows-build-tools. Вот ошибки:

C:\Users\qiansijianhao>cnpm i -g opencv4nodejs
Downloading opencv4nodejs to F:\nodejs\node_global\node_modules\opencv4nodejs_tmp
Copying F:\nodejs\node_global\node_modules\opencv4nodejs_tmp\_opencv4nodejs@5.6.0@opencv4nodejs to F:\nodejs\node_global\node_modules\opencv
4nodejs
Installing opencv4nodejs's dependencies to F:\nodejs\node_global\node_modules\opencv4nodejs/node_modules
[1/5] nan@^2.14.0 installed at node_modules\_nan@2.14.1@nan
[2/5] native-node-utils@^0.2.7 installed at node_modules\_native-node-utils@0.2.7@native-node-utils
[3/5] @types/node@>6 installed at node_modules\_@types_node@14.0.27@@types\node
[4/5] opencv-build@^0.1.9 installed at node_modules\_opencv-build@0.1.9@opencv-build
[5/5] npmlog@^4.1.2 installed at node_modules\_npmlog@4.1.2@npmlog
execute post install 2 scripts...
[1/2] scripts.install opencv-build@^0.1.9 run "node ./install.js", root: "F:\\nodejs\\node_global\\node_modules\\opencv4nodejs\\node_modules
\\_opencv-build@0.1.9@opencv-build"
info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
info readAutoBuildFile file does not exists: F:\nodejs\node_global\node_modules\opencv4nodejs\node_modules\_opencv-build@0.1.9@opencv-build\
opencv\auto-build.json F:\nodejs\node_global\node_modules\opencv4nodejs\node_modules\_opencv-build@0.1.9@opencv-build\opencv\auto-build.json

info install failed to find auto-build.json: F:\nodejs\node_global\node_modules\opencv4nodejs\node_modules\_opencv-build@0.1.9@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.10.0.windows.1
info install
info install executing: cmake --version
info install cmake --version: cmake version 3.18.1
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\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe',
info install   version: 15
info install }
info install installing opencv version 3.4.6 into directory: F:\nodejs\node_global\node_modules\opencv4nodejs\node_modules\_opencv-build@0.1
.9@opencv-build\opencv
Cloning into 'opencv_contrib'...
remote: Enumerating objects: 2160, done.
remote: Counting objects: 100% (2160/2160), done.
remote: Compressing objects: 100% (1916/1916), done.
error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
ERR! child process exited with code 128 (for more info, set '--loglevel silly')
[npminstall:runscript:error] opencv-build@^0.1.9 scripts.install run "node ./install.js" error: Error [RunScriptError]: Run "C:\Windows\syst
em32\cmd.exe /d /s /c node ./install.js" error, exit code 1
    at ChildProcess.<anonymous> (F:\nodejs\node_global\node_modules\cnpm\node_modules\runscript\index.js:96:21)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  stdio: [Object],
  exitcode: 1
}
Install fail! RunScriptError: post install error, please remove node_modules before retry!
Run "C:\Windows\system32\cmd.exe /d /s /c node ./install.js" error, exit code 1
RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node ./install.js" error, exit code 1
    at ChildProcess.<anonymous> (F:\nodejs\node_global\node_modules\cnpm\node_modules\runscript\index.js:96:21)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npminstall version: 3.27.0
npminstall args: F:\nodejs\node.exe F:\nodejs\node_global\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --chin
a --userconfig=C:\Users\qiansijianhao\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org -g opencv4no
dejs
...