0

Trying to install the windows-registry module. Installing windows-registry requires python v2.7 and Visual Studio build tools for node-gyp according to node-gyp documentation but when i run python version 2.7 i get error:

gyp ERR! find Python - version is 2.7.18 - should be >=3.6.0

so i should use latest python. i think this link needs a update in npm website.

  • Install tools and configuration manually:

Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" if using a version older than VS2019, otherwise use "Desktop development with C++" workload) or Visual Studio Community (using the "Desktop development with C++" workload)

Visual Studio build tools python have been installed and configured in nodejs(v17.9.1)` by using : (downgrading nodejs reason)

 npm config edit

and here is the error i get when i try npm install windows-registry:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ffi',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\kigir\Desktop\demo\group\node_modules\ffi'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ffi'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\kigir\Desktop\demo\group\node_modules\cpu-features'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\cpu-features'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\kigir\Desktop\demo\group\node_modules\ref
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!
npm ERR!   binding.cc
npm ERR! C:\Users\kigir\Desktop\demo\group\node_modules\ref\src\binding.cc(222,28): error C2660: 'v8::Value::BooleanValue': function does not take 0 arguments [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
npm ERR! C:\Users\kigir\AppData\Local\node-gyp\Cache\17.9.1\include\node\v8-value.h(408,8): message : see declaration of 'v8::Value::BooleanValue' [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
npm ERR! C:\Users\kigir\Desktop\demo\group\node_modules\ref\src\binding.cc(222,28): message : while trying to match the argument list '()' [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
npm ERR! C:\Users\kigir\Desktop\demo\group\node_modules\ref\src\binding.cc(253,24): error C2660: 'v8::Value::Uint32Value': function does not take 0 arguments [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
npm ERR! C:\Users\kigir\AppData\Local\node-gyp\Cache\17.9.1\include\node\v8-value.h(416,41): message : see declaration of 'v8::Value::Uint32Value' [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
npm ERR! C:\Users\kigir\Desktop\demo\group\node_modules\ref\src\binding.cc(253,24): message : while trying to match the argument list '()' [C:\Users\kigir\Desktop\demo\group\node_modules\ref\build\binding.vcxproj]
...
(the error lines was huge, you can find the full txt down of this qoute)


npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@17.9.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.4 found at "C:\Python311\python.exe"
npm ERR! gyp info find VS using VS2022 (17.6.33829.357) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python311\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\npm\\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\\kigir\\Desktop\\demo\\group\\node_modules\\ref\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\kigir\\AppData\\Local\\node-gyp\\Cache\\17.9.1\\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\\kigir\\AppData\\Local\\node-gyp\\Cache\\17.9.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\kigir\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.9.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ref',
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\\kigir\\Desktop\\demo\\group\\node_modules\\ref\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\kigir\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\kigir\Desktop\demo\group\node_modules\ref
npm ERR! gyp ERR! node -v v17.9.1
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kigir\AppData\Local\npm-cache\_logs\2023-08-11T06_55_59_517Z-debug-0.log

(full error link)

i tried removing node_modules and package-lock.json using this question but i get this error:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ffi',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\kigir\Desktop\demo\group\node_modules\ffi'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ffi'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\kigir\Desktop\demo\group\node_modules\ssh2'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\kigir\\Desktop\\demo\\group\\node_modules\\ssh2'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\kigir\Desktop\demo\group\node_modules\ref
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!
npm ERR!   binding.cc

... (The rest of the errors provided in the last error box)

yes i tried installing Windows-build-tools using option 2 in node-gyp but still the same error.

i even tried to run this command manually :

C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild

The error i get:

gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@17.9.1 | win32 | x64
gyp info find Python using Python version 3.11.4 found at "C:\Python311\python.exe"
gyp info find VS using VS2022 (17.6.33829.357) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python311\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
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\\kigir\\Desktop\\demo\\group\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\kigir\\AppData\\Local\\node-gyp\\Cache\\17.9.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\kigir\\AppData\\Local\\node-gyp\\Cache\\17.9.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\kigir\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.9.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\kigir\\Desktop\\demo\\group',
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\\kigir\\Desktop\\demo\\group\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp: binding.gyp not found (cwd: C:\Users\kigir\Desktop\demo\group) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\kigir\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kigir\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\kigir\Desktop\demo\group
gyp ERR! node -v v17.9.1
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok

i think i missed a little point but im not able to see it. i would be glad to found help in this problem which have been stuck it for several days. I have tried to look at the problem from different angles and done research, but I still can't seem to find the solution. I hope to find someone who can help me figure out what I'm missing.

jexroid
  • 11
  • 4

1 Answers1

0

One of the methods i researched is using regit which has better support than windows-registry windows-registry has been outdated for 4 years but regedit is a long support package

it's a better option because :

  • needs no dependencies
  • more functionality
  • easy to install

regedit link

I hope you found this helpful but I'm eager to know other solutions

jexroid
  • 11
  • 4