0
當運行「故宮安裝OpenCV」這是我所得到的錯誤與故宮安裝OpenCV
> if not defined npm_config_node_gyp (node "C:\Users\Shaun\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\.
.\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\Shaun\node_modules\opencv\bui
ld\opencv\v4.0.0\Release\node-v46-win32-ia32\opencv.node --module_name=opencv --module_path=C:\Users\Shaun\node_module
s\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32 --python=python2.7 --msvs_version=2015) else (node configu
re --fallback-to-build --module=C:\Users\Shaun\node_modules\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32\ope
ncv.node --module_name=opencv --module_path=C:\Users\Shaun\node_modules\opencv\build\opencv\v4.0.0\Release\node-v46-wi
n32-ia32 --python=python2.7 --msvs_version=2015)
[email protected] C:\Users\Shaun\node_modules\opencv
> if not defined npm_config_node_gyp (node "C:\Users\Shaun\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\.
.\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\Shaun\node_modules\opencv\build\o
pencv\v4.0.0\Release\node-v46-win32-ia32\opencv.node --module_name=opencv --module_path=C:\Users\Shaun\node_modules\op
encv\build\opencv\v4.0.0\Release\node-v46-win32-ia32) else (node build --fallback-to-build --module=C:\Users\Shaun\
node_modules\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32\opencv.node --module_name=opencv --module_path=C:\
Users\Shaun\node_modules\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\Shaun\node_modules\opencv\build\opencv.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.
Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists
on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Shaun\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\l
ib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Shaun\\AppData\\Roaming\\npm\\node_modules\\n
pm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Shaun\\node_modules\\
opencv\\build\\opencv\\v4.0.0\\Release\\node-v46-win32-ia32\\opencv.node" "--module_name=opencv" "--module_path=C:\\Us
ers\\Shaun\\node_modules\\opencv\\build\\opencv\\v4.0.0\\Release\\node-v46-win32-ia32"
gyp ERR! cwd C:\Users\Shaun\node_modules\opencv
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\Shaun\node_
modules\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32\opencv.node --module_name=opencv --module_path=C:\Users
\Shaun\node_modules\opencv\build\opencv\v4.0.0\Release\node-v46-win32-ia32' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Shaun\node_modules\opencv\node_modules\node-pre-gyp\
lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Shaun\\node_modules\\opencv\\node_mo
dules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Shaun\node_modules\opencv
node-pre-gyp ERR! node -v v4.2.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.17
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\Shaun\node_modules\opencv\build\opencv\v4.
0.0\Release\node-v46-win32-ia32\opencv.node --module_name=opencv --module_path=C:\Users\Shaun\node_modules\opencv\buil
d\opencv\v4.0.0\Release\node-v46-win32-ia32' (1)
npm WARN optional Skipping failed optional dependency /node-inspector/biased-opener/x-default-browser/default-browser-
id:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Shaun\package.json'
npm WARN Shaun No description
npm WARN Shaun No repository field.
npm WARN Shaun No README data
npm WARN Shaun No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Shaun\\AppData\\Roaming\\npm\\node_modules\\npm\
\bin\\npm-cli.js" "install" "opencv"
npm ERR! node v4.2.4
npm ERR! npm v3.5.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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 opencv 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
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs opencv
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Shaun\npm-debug.log
我一直在努力的點點滴滴通過每個錯誤工作,我認真只是不能找出什麼是錯在這裏。
我正在使用OpenCV作爲大學項目的一部分在Web應用程序中使用。任何人都可以幫助我這個請做。
謝謝。
您是否安裝了OpenCV 3.x?我在3.0中遇到了同樣的問題,並使用OpenCV 2.4解決了這個問題。 – fdelia