简体   繁体   中英

how to install opencv4nodejs for windows 10

I am not able to install opencv4nodejs when I write npm install opencv4nodejs this gives a result

npm ERR! code 1
npm ERR! path D:\nikunj\Programming\testapp2\node_modules\opencv4nodejs
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./install/install.js
npm ERR! info install using lib dir: D:/nikunj/Programming/testapp2/node_modules/opencv- 
build/opencv/build/lib/Release
npm ERR! D:\nikunj\Programming\testapp2\node_modules\opencv4nodejs\install\install.js:37
npm ERR!   throw new Error('library dir does not exist: ' + libDir)
npm ERR!   ^
npm ERR!
npm ERR! Error: library dir does not exist: D:/nikunj/Programming/testapp2/node_modules/opencv- 
 build/opencv/build/lib/Release
npm ERR!     at Object.<anonymous> 
(D:\nikunj\Programming\testapp2\node_modules\opencv4nodejs\install\install.js:37:9)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1102:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:967:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:807:14)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
npm ERR!     at node:internal/main/run_main_module:17:47

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\digital\AppData\Local\npm-cache\_logs\2021-01-25T06_54_47_181Z-debug.log`

opencv4nodejs installation through auto build seems broken with Node.js current version (15.7.0). Until a possible fix, try with an earlier version of Node.js, 14.15.4 should work.

opencv4nodejs dose not support to the current node version yet. You can use nvm (Node Version Manager) to handle your node version. You can switch your node version using nvm

If you switch to new version then run

npm rebuid

Inside your node package then it rebuild to the new version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM