gpt4 book ai didi

node.js - 用于 windows 的 node-opencv

转载 作者:行者123 更新时间:2023-12-02 17:53:32 25 4
gpt4 key购买 nike

我正在尝试在 windows7 中安装 node-opencv 或 opencv-node 作为 Node 模块。
可以从命令提示符访问 node 和 node-gyp。
设置了 Python 和 env 变量。
我相信 openCV 至少安装到拥有预建库的程度。
但是对于 node-opencv 和 opencv-node 我都得到了同样的错误。

gyp info it worked if it ends with ok
gyp info using node-gyp@0.7.3
gyp info using node@0.8.9 | win32 | ia32
gyp ERR! configure error
gyp ERR! stack Error: Command failed: File "<string>", line 1
gyp ERR! stack import platform; print platform.python_version();
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:540:15)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Users\\Chris\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
"build"
gyp ERR! cwd C:\wamp\www\serv\opencv-node
gyp ERR! node -v v0.8.9
gyp ERR! node-gyp -v v0.7.3
gyp ERR! not ok

日志文件说的几乎相同,任何帮助表示赞赏!

- 更新,安装 python 2.7.3 后,我现在收到此错误:
C:\Users\Chris\AppData\Roaming\npm\node_modules\opencv-node>node "C:\Program Fil
es (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\b
in\node-gyp.js" configure build
gyp ERR! configure error
gyp ERR! stack Error: Command failed: CreateProcessW: The system cannot find the
file specified.
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:540:15)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
gyp ERR! stack at Socket.EventEmitter.emit (events.js:88:17)
gyp ERR! stack at Socket._destroy.destroyed (net.js:357:10)
gyp ERR! stack at process.startup.processNextTick.process._tickCallback (nod
e.js:244:9)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\Chris\AppData\Roaming\npm\node_modules\opencv-node
gyp ERR! node -v v0.8.9
gyp ERR! node-gyp -v v0.6.8
gyp ERR! not ok
npm ERR! opencv-node@0.2.6 install: `node-gyp configure build`
npm ERR! `cmd "/c" "node-gyp configure build"` failed with 1
npm ERR!
npm ERR! Failed at the opencv-node@0.2.6 install script.
npm ERR! This is most likely a problem with the opencv-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls opencv-node
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "opencv-node
"
npm ERR! cwd C:\wamp\www\serv\opencv-node
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\wamp\www\serv\opencv-node\npm-debug.log
npm ERR! not ok code 0

最佳答案

我有类似的麻烦。
我的解决方案是以管理员身份启动“VS2015 的开发人员命令提示符”(您需要安装 Visual Studio)。
只有在其中我才能安装opencv(npm i opencv)而不会出错,但会出现警告。
也许,它也会帮助你!

关于node.js - 用于 windows 的 node-opencv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13321496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com