簡體   English   中英

在Node.js中安裝OpenCV時出錯

[英]Error while installing opencv in nodejs

我正在嘗試在Windows 10的nodejs中安裝opencv,但是遇到錯誤,有什么可以幫助我的嗎?

     gyp ERR! build error
        gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
        gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
        gyp ERR! stack     at emitTwo (events.js:125:13)
        gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
        gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
        gyp ERR! System Windows_NT 10.0.15063
        gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\opencv\\build\\opencv\\v6.0.0\\Release\\node-v57-win32-x64\\opencv.node" "--module_name=opencv" "--module_path=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\opencv\\build\\opencv\\v6.0.0\\Release\\node-v57-win32-x64"
        gyp ERR! cwd C:\Program Files\nodejs\node_modules\npm\node_modules\opencv
        gyp ERR! node -v v8.2.1
        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 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Program Files\nodejs\node_modules\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v57-win32-x64\opencv.node
--module_name=opencv --module_path=C:\Program Files\nodejs\node_modules\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v57-win32-x64' (1)
        node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\opencv\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:921:16)
        node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
        node-pre-gyp ERR! System Windows_NT 10.0.15063
        node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\opencv\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
        node-pre-gyp ERR! cwd C:\Program Files\nodejs\node_modules\npm\node_modules\opencv
        node-pre-gyp ERR! node -v v8.2.1
        node-pre-gyp ERR! node-pre-gyp -v v0.6.36
        node-pre-gyp ERR! not ok
        Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Program Files\nodejs\node_modules\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v57-win32-x64\opencv.node
--module_name=opencv --module_path=C:\Program Files\nodejs\node_modules\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v57-win32-x64' (1)
        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!     C:\Users\suresh\AppData\Roaming\npm-cache\_logs\2017-08-03T18_05_40_307Z-debug.log

        C:\Program Files\nodejs\node_modules\npm>

嘗試從此處下載Visual C ++ 2015 Build Tools。

安裝后,運行以下命令:

npm config -g set msvs_version 2015

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM