我正在尝试在Windows 8上为nodeJs安装open-cv
我下载了NodeJs,安装了它 已安装的python for windows 32 bit OpenCV 2.3.1
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
答案 0 :(得分:0)
当我尝试安装“ldapauth”时,我在Windows 8 x64上遇到了同样的问题。错误来自node-gyp。查看https://npmjs.org/package/node-gyp上的安装说明。我也解决了从PATH中排除Python并将变量PYTHON设置为空的问题。