UrielCh / opencv4nodejs

ESM Nodejs bindings to OpenCV 3/4
MIT License
247 stars 51 forks source link

Error build #146

Closed Jambickz closed 1 month ago

Jambickz commented 4 months ago

when running npm install @u4/opencv4nodejs i get this error

windows 11 v18.20.3 Python 3.10.0 cmake version 3.29.3 Visual studio tools 2022 node-gyp v10.1.0 I don't have defender

package.json file package.json

Log console:

PS S:\coding\project\test> npm i @u4/opencv4nodejs
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated npmlog@7.0.1: This package is no longer supported.
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated are-we-there-yet@4.0.2: This package is no longer supported.
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated gauge@5.0.2: This package is no longer supported.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'S:\\coding\\project\\test\\node_modules\\@u4\\opencv4nodejs',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'S:\coding\project\test\node_modules\@u4\opencv4nodejs\node_modules\@u4\opencv-build\script\opencv-4.9.0-8b1ea\build\3rdparty'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'S:\\coding\\project\\test\\node_modules\\@u4\\opencv4nodejs\\node_modules\\@u4\\opencv-build\\script\\opencv-4.9.0-8b1ea\\build\\3rdparty'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path S:\coding\project\test\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 node-gyp@10.1.0
npm error gyp info using node@18.20.3 | win32 | x64
npm error gyp info find Python using Python version 3.10.0 found at "C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\python.exe"
npm error gyp info find VS using VS2022 (17.10.34928.147) 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\ADMIN\AppData\Local\Programs\Python\Python310\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'S:\\coding\\project\\test\\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 'S:\\coding\\project\\test\\node_modules\\@u4\\opencv4nodejs\\build\\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'S:\\coding\\project\\test\\node_modules\\node-gyp\\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\ADMIN\\AppData\\Local\\node-gyp\\Cache\\18.20.3\\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\\ADMIN\\AppData\\Local\\node-gyp\\Cache\\18.20.3',
npm error gyp info spawn args '-Dnode_gyp_dir=S:\\coding\\project\\test\\node_modules\\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\ADMIN\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.20.3\\\\<(target_arch)\\\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=S:\\coding\\project\\test\\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 'S:\\coding\\project\\test\\node_modules\\@u4\\opencv4nodejs\\build',        
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>      
npm error     sys.exit(gyp.script_main())
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 688, in script_main
npm error     return main(sys.argv[1:])
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 680, in main
npm error     return gyp_main(args)
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 647, in gyp_main
npm error     [generator, flat_list, targets, data] = Load(
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 157, in Load
npm error     result = gyp.input.Load(
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 2985, in Load 
npm error     LoadTargetBuildFile(
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 427, in LoadTargetBuildFile
npm error     ProcessVariablesAndConditionsInDict(
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1399, in ProcessVariablesAndConditionsInDict
npm error     ProcessVariablesAndConditionsInList(value, phase, variables, build_file)
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1412, in ProcessVariablesAndConditionsInList
npm error     ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1399, in ProcessVariablesAndConditionsInDict
npm error     ProcessVariablesAndConditionsInList(value, phase, variables, build_file)
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1416, in ProcessVariablesAndConditionsInList
npm error     expanded = ExpandVariables(item, phase, variables, build_file)
npm error   File "S:\coding\project\test\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 1050, in ExpandVariables
npm error     output = shlex.split(str(replacement))
npm error   File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 315, in split
npm error     return list(lex)
npm error   File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 300, in __next__
npm error     token = self.get_token()
npm error   File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 109, in get_token
npm error     raw = self.read_token()
npm error   File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 191, in read_token
npm error     raise ValueError("No closing quotation")
npm error ValueError: No closing quotation 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> (S:\coding\project\test\node_modules\node-gyp\lib\configure.js:297:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm error gyp ERR! System Windows_NT 10.0.26100
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "S:\\coding\\project\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

npm error gyp ERR! cwd S:\coding\project\test\node_modules\@u4\opencv4nodejs
npm error gyp ERR! node -v v18.20.3
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok

npm error A complete log of this run can be found in: C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2024-06-24T12_01_05_613Z-debug-0.log

LOG file 2024-06-24T12_01_05_613Z-debug-0.log

Jambickz commented 4 months ago

I've been trying to solve this problem myself for about a month, nothing helps. previously there was an error right after building, when I put a different version of python, I managed to at least start compiling, but after 10 minutes of waiting, the error appears.

studentutu commented 4 months ago

try to use pnpm to install this library - somehow it works, yarn\npm does not work

GreatHongyu commented 1 month ago

try to use pnpm to install this library - somehow it works, yarn\npm does not work

boss,pnpm not work for me T0T

PS C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm> pnpm install @u4/opencv4nodejs -D Packages: +204 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 204, reused 203, downloaded 1, added 1, done node_modules/.pnpm/@u4+opencv4nodejs@7.1.1_typescript@5.5.4/node_modules/@u4/opencv4nodejs: Running installnode_modules/.pnpm/@u4+opencv4nodejs@7.1.1_typescript@5.5.4/node_modules/@u4/opencv4nodejs: Running install script, failed in 12.3s .../node_modules/@u4/opencv4nodejs install$ node-gyp rebuild │ gyp info it worked if it ends with ok │ gyp info using node-gyp@10.2.0 │ gyp info using node@20.16.0 | win32 | x64 │ gyp info find Python using Python version 3.11.2 found at "C:\Users\Administrator\AppData\Local\Progra…
│ gyp info find VS using VS2019 (16.11.35130.168) found at: │ gyp info find VS "I:\SOFT\soft\VS2019" │ gyp info find VS run with --verbose for detailed information │ gyp info spawn C:\Users\Administrator\AppData\Local\Programs\Python\Python311\python.exe │ gyp info spawn args [ │ gyp info spawn args 'C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules\.pnpm…
│ gyp info spawn args 'binding.gyp', │ gyp info spawn args '-f', │ gyp info spawn args 'msvs', │ gyp info spawn args '-I', │ gyp info spawn args 'C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules\.pnpm…
│ gyp info spawn args '-I', │ gyp info spawn args 'C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules\.pnpm…
│ gyp info spawn args '-I', │ gyp info spawn args 'C:\Users\Administrator\AppData\Local\node-gyp\Cache\20.16.0\include\node…
│ gyp info spawn args '-Dlibrary=shared_library', │ gyp info spawn args '-Dvisibility=default', │ gyp info spawn args '-Dnode_root_dir=C:\Users\Administrator\AppData\Local\node-gyp\Cache\20.16.…
│ gyp info spawn args '-Dnode_gyp_dir=C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node…
│ gyp info spawn args '-Dnode_lib_file=C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\C…
│ gyp info spawn args '-Dmodule_root_dir=C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\n…
│ gyp info spawn args '-Dnode_engine=v8', │ gyp info spawn args '--depth=.', │ gyp info spawn args '--no-parallel', │ gyp info spawn args '--generator-output', │ gyp info spawn args 'C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules\.pnpm…
│ gyp info spawn args '-Goutput_dir=.' │ gyp info spawn args ] │ gyp info spawn I:\SOFT\soft\VS2019\MSBuild\Current\Bin\MSBuild.exe │ gyp info spawn args [ │ gyp info spawn args 'build\binding.sln', │ gyp info spawn args '/clp:Verbosity=minimal', │ gyp info spawn args '/nologo', │ gyp info spawn args '/p:Configuration=Release;Platform=x64' │ gyp info spawn args ] │ �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء� │ I:\SOFT\soft\VS2019\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: �…
│ gyp ERR! build error │ gyp ERR! stack Error: I:\SOFT\soft\VS2019\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
│ gyp ERR! stack at ChildProcess. (C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\no…
│ gyp ERR! stack at ChildProcess.emit (node:events:519:28) │ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) │ gyp ERR! System Windows_NT 10.0.19045 │ gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator\Desktop\opencv\ope…
│ gyp ERR! cwd C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules.pnpm\@u4+opencv4nod…
│ gyp ERR! node -v v20.16.0 │ gyp ERR! node-gyp -v v10.2.0 │ gyp ERR! not ok └─ Failed in 12.3s at C:\Users\Administrator\Desktop\opencv\opencv4nodejs-npm\node_modules.pnpm\@u4+opencv4nodejs@7.1.1_typescript@5.5.4\node_modules\@u4\opencv4nodejs  ELIFECYCLE  Command failed with exit code 1.