opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

Issues with node-gyp

Open Fy50167 opened this issue 1 year ago • 4 comments

The following errors occurs when running both npm i @u4/opencv4nodejs and npm i opencv4nodejs

npm WARN deprecated [email protected]: This package is no longer supported. npm WARN deprecated [email protected]: This package is no longer supported. npm WARN deprecated [email protected]: This package is no longer supported. npm WARN cleanup Failed to remove some directories [ npm WARN cleanup [ npm WARN cleanup 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\@u4\opencv4nodejs', npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\Fy501\Desktop\perimeter_code\node_modules@u4\opencv4nodejs\node_modules\eslint'] { npm WARN cleanup errno: -4048, npm WARN cleanup code: 'EPERM', npm WARN cleanup syscall: 'rmdir', npm WARN cleanup path: 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\@u4\opencv4nodejs\node_modules\eslint' npm WARN cleanup } npm WARN cleanup ] npm WARN cleanup ] npm ERR! code 1 npm ERR! path C:\Users\Fy501\Desktop\perimeter_code\node_modules@u4\opencv4nodejs npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.12.0 found at "C:\Users\Fy501\AppData\Local\Programs\Python\Python312\python.exe" npm ERR! gyp info find VS using VS2022 (17.10.34928.147) found at: npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm ERR! gyp info find VS run with --verbose for detailed information npm ERR! gyp info spawn C:\Users\Fy501\AppData\Local\Programs\Python\Python312\python.exe npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\node-gyp\gyp\gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'msvs', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\@u4\opencv4nodejs\build\config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\node-gyp\addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args 'C:\Users\Fy501\AppData\Local\node-gyp\Cache\21.5.0\include\node\common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\Fy501\AppData\Local\node-gyp\Cache\21.5.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Users\Fy501\Desktop\perimeter_code\node_modules\node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\Fy501\\AppData\\Local\\node-gyp\\Cache\\21.5.0\\<(target_arch)\\node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\Users\Fy501\Desktop\perimeter_code\node_modules\@u4\opencv4nodejs', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'C:\Users\Fy501\Desktop\perimeter_code\node_modules\@u4\opencv4nodejs\build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess. (C:\Users\Fy501\Desktop\perimeter_code\node_modules\node-gyp\lib\configure.js:297:18) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:519:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) npm ERR! gyp ERR! System Windows_NT 10.0.19045 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Fy501\Desktop\perimeter_code\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\Users\Fy501\Desktop\perimeter_code\node_modules@u4\opencv4nodejs npm ERR! gyp ERR! node -v v21.5.0 npm ERR! gyp ERR! node-gyp -v v10.1.0 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\Fy501\AppData\Local\npm-cache_logs\2024-05-31T22_55_31_440Z-debug-0.log

Fy50167 avatar May 31 '24 22:05 Fy50167

Same here. node v18

stoefln avatar Oct 14 '24 14:10 stoefln

Hi, did you solve this somehow?

skizzo avatar Nov 11 '24 21:11 skizzo

help same error

emptydn1 avatar Nov 29 '24 09:11 emptydn1

Doing an npm install of @u4/opencv-build first addressed the OPENCV4NODEJS_DEFINES issue for me. It's a dependency but it's not guaranteed to be present when the install script (which requires it) is run.

brcarp avatar Feb 06 '25 07:02 brcarp