Skip to content

node-gyp is broken and I've done everything physically possible #3274

Description

@cow1337killer3

I have tried every possible solution available across the entire internet. This cannot be fixed. Why does node-gyp ship broken by default?

npm install -g node-gyp
>>

changed 63 packages in 2s
choco install python visualcpp-build-tools -y
>>
Chocolatey v2.2.2
Installing the following packages:
python;visualcpp-build-tools
By installing, you accept licenses for the packages.
python v3.14.2 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.
visualcpp-build-tools v15.0.26228.20170424 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Warnings:
 - python - python v3.14.2 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.
 - visualcpp-build-tools - visualcpp-build-tools v15.0.26228.20170424 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.
 where.exe python
C:\Python314\python.exe
C:\Program Files\Python313\python.exe
C:\Users\Brandon\AppData\Local\Microsoft\WindowsApps\python.exe
py --list-paths
 -V:3.14 *        C:\Python314\python.exe
 -V:3.13          C:\Program Files\Python313\python.exe
$Env:npm_config_python="C:\Python314\python.exe"
Install-Module VSSetup -Scope CurrentUser
Image Image
npm install --global windows-build-tools
>>
npm warn Unknown env config "python". This will stop working in the next major version of npm.
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 glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\node_modules\ajv\lib'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools\\node_modules\\ajv\\lib'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools\\node_modules\\uri-js',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\node_modules\uri-js\dist\esnext'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools\\node_modules\\uri-js\\dist\\esnext'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools\\node_modules\\verror',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\node_modules\verror\node_modules\core-util-is'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\windows-build-tools\\node_modules\\verror\\node_modules\\core-util-is'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools
npm error command failed
npm error command pwsh -c node ./dist/index.js
npm error Downloading python-2.7.15.amd64.msi
npm error [>                                            ] 0.0% (0 B/s)
npm error ^[[1000D^[[0K^[[1A^[[1000D^[[0K^[[1A^[[1000D^[[0KDownloading python-2.7.15.amd64.msi
npm error [============================================>] 100.0% (0 B/s)
npm error ^[[1000D^[[0K^[[1A^[[1000D^[[0K^[[1A^[[1000D^[[0KDownloading python-2.7.15.amd64.msi
npm error [============================================>] 100.0% (0 B/s)
npm error Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\Brandon\.windows-build-tools\python-2.7.15.amd64.msi.
npm error
npm error
npm error ^[[1000D^[[0K^[[1A^[[1000D^[[0K^[[1A^[[1000D^[[0KDownloading vs_BuildTools.exe
npm error [>                                            ] 0.0% (0 B/s)
npm error ^[[1000D^[[0K^[[1A^[[1000D^[[0K^[[1A^[[1000D^[[0KDownloading vs_BuildTools.exe
npm error [============================================>] 100.0% (0 B/s)
npm error ^[[1000D^[[0K^[[1A^[[1000D^[[0K^[[1A^[[1000D^[[0KDownloading vs_BuildTools.exe
npm error [============================================>] 100.0% (0 B/s)
npm error Downloaded vs_BuildTools.exe. Saved to C:\Users\Brandon\.windows-build-tools\vs_BuildTools.exe.
npm error
npm error Starting installation...
npm error Downloading installers failed. Error: TypeError: 'process.env' only accepts a configurable, writable, and enumerable data descriptor
npm error     at Object.defineProperty (<anonymous>)
npm error     at Object.removePath (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\dist\utils\remove-path.js:11:12)
npm error     at Object.install (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\dist\install\index.js:29:19)
npm error     at C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\dist\start.js:17:19
npm error     at Object.download (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\dist\download.js:35:5)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
npm error     at async Object.aquireInstallers (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\windows-build-tools\dist\aquire-installers.js:32:13) {
npm error   code: 'ERR_INVALID_OBJECT_DEFINE_PROPERTY'
npm error }
npm error windows-build-tools will now exit.
npm error (node:4532) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error A complete log of this run can be found in: C:\Users\Brandon\AppData\Local\npm-cache\_logs\2026-01-26T01_30_05_007Z-debug-0.log
npm config set msvs_version 2022
npm warn Unknown env config "python". This will stop working in the next major version of npm.
npm error `msvs_version` is not a valid npm option
npm error A complete log of this run can be found in: C:\Users\Brandon\AppData\Local\npm-cache\_logs\2026-01-26T01_31_09_670Z-debug-0.log

And finally, trying to run node-gyp:

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@12.1.0
gyp info using node@25.4.0 | win32 | x64
(node:16148) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:16148) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
gyp info find Python using Python version 3.14.2 found at "C:\Python314\python.exe"

gyp info find VS using VS2022 (17.14.36915.13) 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:\Python314\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\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\\Brandon\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Local\\node-gyp\\Cache\\25.4.0\\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\\Brandon\\AppData\\Local\\node-gyp\\Cache\\25.4.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.4.0\\installation\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Brandon\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\25.4.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Brandon',
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\\Brandon\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp: binding.gyp not found (cwd: C:\Users\Brandon) 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.<anonymous> (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.4.0\installation\node_modules\node-gyp\lib\configure.js:317:18)
gyp ERR! stack at ChildProcess.emit (node:events:508:20)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Windows_NT 10.0.26200
gyp ERR! command "C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\aliases\\default\\node.exe" "C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\aliases\\default\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Brandon
gyp ERR! node -v v25.4.0
gyp ERR! node-gyp -v v12.1.0
gyp ERR! not ok

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions