Issues with node-gyp
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.
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
Same here. node v18
Hi, did you solve this somehow?
help same error
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.