0

我正在尝试在 Windows 8 上为 nodeJs 安装 open-cv

我下载了 NodeJs,安装了它为 windows 32 位OpenCV 2.3.1安装了 python

SET PYTHON=C:\Python33
SET %PATH%;C:\PYTHON33

下载 opencv 3.4.1 然后运行 ​​npm install opencv 这是结果:

C:\projects>npm install opencv
npm http GET https://registry.npmjs.org/opencv
>npm http 304 https://registry.npmjs.org/opencv
>opencv@0.3.1 preinstall C:\copter\node_modules\opencv
node-gyp clean rebuild
C:\projects\node_modules\opencv>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:980:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:771:34)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "clean" "rebuild"
gyp ERR! cwd C:\copter\node_modules\opencv
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

更新:

也试过

C:\projects\node_modules>npm install opencv-node
npm http GET https://registry.npmjs.org/opencv-node
npm http 200 https://registry.npmjs.org/opencv-node
npm http GET https://registry.npmjs.org/opencv-node/-/opencv-node-0.2.6.tgz
npm http 200 https://registry.npmjs.org/opencv-node/-/opencv-node-0.2.6.tgz
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/keypress
npm http 200 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/keypress/-/keypress-0.2.1.tgz
npm http 200 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/coffee-script/-/coffee-script-1.6.3.tgz
npm http 200 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz
npm http 200 https://registry.npmjs.org/keypress/-/keypress-0.2.1.tgz
npm http 200 https://registry.npmjs.org/coffee-script/-/coffee-script-1.6.3.tgz
npm http 200 https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz

> opencv-node@0.2.6 install C:\copter\node_modules\opencv-node
> node-gyp configure build


C:\projects\node_modules\opencv-node>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\nod
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:980:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:771:34)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.
gyp ERR! cwd C:\copter\node_modules\opencv-node
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
4

1 回答 1

0

当我尝试安装“ldapauth”时,我在 Windows 8 x64 上遇到了同样的问题。错误来自 node-gyp。检查https://npmjs.org/package/node-gyp上的安装说明。我还解决了从 PATH 中排除 Python 并将变量 PYTHON 设置为空的问题。

于 2013-10-29T16:45:03.620 回答