opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

error when installing u4/opencv4node

Open Idealyy opened this issue 1 year ago • 7 comments

npm install --save @u4/opencv4nodejs npm error code 1 npm error path D:\learnnode\node_modules@u4\opencv4nodejs npm error command failed npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm error gyp info it worked if it ends with ok npm error gyp info using [email protected] npm error gyp info using [email protected] | win32 | x64 npm error gyp info find Python using Python version 3.12.6 found at "C:\Python312\python.exe" npm error gyp info find VS using VS2022 (17.11.35312.102) found at: npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm error gyp info find VS run with --verbose for detailed information npm error gyp info spawn C:\Python312\python.exe npm error gyp info spawn args [ npm error gyp info spawn args 'D:\learnnode\node_modules\node-gyp\gyp\gyp_main.py', npm error gyp info spawn args 'binding.gyp',

Idealyy avatar Sep 23 '24 12:09 Idealyy

your error message is trunctated.

UrielCh avatar Sep 24 '24 08:09 UrielCh

your error message is trunctated.

sorry, let me put the full error here @UrielCh

PS D:\learnnode> npm install --save @u4/opencv4nodejs --force npm warn using --force Recommended protections disabled. npm warn cleanup Failed to remove some directories [ npm warn cleanup [ npm warn cleanup '\\\\?\\D:\\learnnode\\node_modules\\@u4\\opencv-build', npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'D:\learnnode\node_modules\@u4\opencv-build\script\deps\jsr.io'] { npm warn cleanup errno: -4048, npm warn cleanup code: 'EPERM', npm warn cleanup syscall: 'rmdir', npm warn cleanup path: 'D:\\learnnode\\node_modules\\@u4\\opencv-build\\script\\deps\\jsr.io' npm warn cleanup } npm warn cleanup ] npm warn cleanup ] npm error code 1 npm error path D:\learnnode\node_modules\@u4\opencv4nodejs npm error command failed npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm error gyp info it worked if it ends with ok npm error gyp info using [email protected] npm error gyp info using [email protected] | win32 | x64 npm error gyp info find Python using Python version 3.9.0 found at "C:\Users\ideal\AppData\Local\Programs\Python\Python39\python.exe" npm error gyp info find VS using VS2022 (17.11.35312.102) found at: npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm error gyp info find VS run with --verbose for detailed information npm error gyp info spawn C:\Users\ideal\AppData\Local\Programs\Python\Python39\python.exe npm error gyp info spawn args [ npm error gyp info spawn args 'D:\\learnnode\\node_modules\\node-gyp\\gyp\\gyp_main.py', npm error gyp info spawn args 'binding.gyp', npm error gyp info spawn args '-f', npm error gyp info spawn args 'msvs', npm error gyp info spawn args '-I', npm error gyp info spawn args 'D:\\learnnode\\node_modules\\@u4\\opencv4nodejs\\build\\config.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'D:\\learnnode\\node_modules\\node-gyp\\addon.gypi', npm error gyp info spawn args '-I', npm error gyp info spawn args 'C:\\Users\\ideal\\AppData\\Local\\node-gyp\\Cache\\22.9.0\\include\\node\\common.gypi', npm error gyp info spawn args '-Dlibrary=shared_library', npm error gyp info spawn args '-Dvisibility=default', npm error gyp info spawn args '-Dnode_root_dir=C:\\Users\\ideal\\AppData\\Local\\node-gyp\\Cache\\22.9.0', npm error gyp info spawn args '-Dnode_gyp_dir=D:\\learnnode\\node_modules\\node-gyp', npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\ideal\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.9.0\\\\<(target_arch)\\\\node.lib', npm error gyp info spawn args '-Dmodule_root_dir=D:\\learnnode\\node_modules\\@u4\\opencv4nodejs', npm error gyp info spawn args '-Dnode_engine=v8', npm error gyp info spawn args '--depth=.', npm error gyp info spawn args '--no-parallel', npm error gyp info spawn args '--generator-output', npm error gyp info spawn args 'D:\\learnnode\\node_modules\\@u4\\opencv4nodejs\\build', npm error gyp info spawn args '-Goutput_dir=.' npm error gyp info spawn args ] npm error gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp npm error gyp ERR! configure error npm error gyp ERR! stack Error: gyp failed with exit code: 1 npm error gyp ERR! stack at ChildProcess.<anonymous> (D:\learnnode\node_modules\node-gyp\lib\configure.js:317:18) npm error gyp ERR! stack at ChildProcess.emit (node:events:519:28) npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12) npm error gyp ERR! System Windows_NT 10.0.22631 npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\learnnode\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" npm error gyp ERR! cwd D:\learnnode\node_modules\@u4\opencv4nodejs npm error gyp ERR! node -v v22.9.0 npm error gyp ERR! node-gyp -v v10.2.0 npm error gyp ERR! not ok npm error A complete log of this run can be found in: C:\Users\ideal\AppData\Local\npm-cache\_logs\2024-09-23T19_34_06_698Z-debug-0.log

Idealyy avatar Sep 24 '24 08:09 Idealyy

https://stackoverflow.com/q/79007863/23628356

Idealyy avatar Sep 24 '24 12:09 Idealyy

@Idealyy this IS the updated fork mentioned in that stackoverflow answer. @UrielCh I am also having this issue installing. Let me know if you need any info. I tried installing @u4/opencv-build, tried restarting computer, didn't work.

Mr-Smarty avatar Jun 06 '25 05:06 Mr-Smarty

Update! Fixed by using the actual env variable OPENCV4NODEJS_DISABLE_AUTOBUILD=1 to indicate manual opencv install instead of the package.json argument and it worked.

Mr-Smarty avatar Jun 06 '25 05:06 Mr-Smarty

So... no more issue for you...

UrielCh avatar Jun 06 '25 06:06 UrielCh

Haha correct, thanks for the package! I am curious why the package.json arguments don't work however

Mr-Smarty avatar Jun 06 '25 08:06 Mr-Smarty