Skip to content

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

Open

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

  1. cclauss commented on Jan 26, 2026

    @cclauss
    Contributor

    npm --version ?

    Modern npm no longer allows config settings for python or msvs_version.

    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.

    Can you please try to remove windows-build-toolsbecause it is attempting to use legacy Python 2 which died on 1/1/2020.

    gyp: binding.gyp not found (cwd: C:\Users\Brandon) while trying to load binding.gyp

  2. cow1337killer3 commented on Mar 15, 2026

    @cow1337killer3
    Author

    Ok, I had forgotten which npm package I wanted to install, which used node-gyp. But now I'm trying to install another package that needs node-gyp.

    npm i -g 'synchronized-promise'
    npm warn cleanup Failed to remove some directories [
    npm warn cleanup   [
    npm warn cleanup     'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\synchronized-promise',
    npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync\build\Release\obj\deasync'] {
    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.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync\\build\\Release\\obj\\deasync'
    npm warn cleanup     }
    npm warn cleanup   ],
    npm warn cleanup   [
    npm warn cleanup     '\\\\?\\C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync',
    npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync\build\Release\obj'] {
    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.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync\\build\\Release\\obj'
    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.6.1\installation\node_modules\synchronized-promise\node_modules\deasync
    npm error command failed
    npm error command pwsh -c node ./build.js
    npm error deasync.cc
    npm error C:\Users\Brandon\AppData\Local\node-gyp\Cache\25.6.1\include\node\v8-object.h(863,45): warning C4996: 'v8::Object::GetIsolate': Use Isolate::GetCurrent() instead, which is guaranteed to return the same isolate since https://crrev.com/c/6458560. [C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync\build\deasync.vcxproj]
    npm error   (compiling source file '../src/deasync.cc')
    npm error
    npm error C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync\src\deasync.cc(3,10): error C1083: Cannot open include file: 'napi.h': No such file or directory [C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync\build\deasync.vcxproj]
    npm error (node:21544) [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.
    npm error (Use `node --trace-deprecation ...` to show where the warning was created)
    npm error gyp info it worked if it ends with ok
    npm error gyp info using node-gyp@12.2.0
    npm error gyp info using node@25.6.1 | win32 | x64
    npm error (node:22480) [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.
    npm error (Use `node --trace-deprecation ...` to show where the warning was created)
    npm error gyp info find Python using Python version 3.14.3 found at "C:\Python314\python.exe"
    npm error gyp info find VS using VS2022 (17.14.36930.0) 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:\Python314\python.exe
    npm error gyp info spawn args [
    npm error gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\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 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync\\build\\config.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\node-gyp\\addon.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args 'C:\\Users\\Brandon\\AppData\\Local\\node-gyp\\Cache\\25.6.1\\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\\Brandon\\AppData\\Local\\node-gyp\\Cache\\25.6.1',
    npm error gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\node-gyp',
    npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Brandon\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\25.6.1\\\\<(target_arch)\\\\node.lib',
    npm error gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync',
    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 'C:\\Users\\Brandon\\AppData\\Roaming\\fnm\\node-versions\\v25.6.1\\installation\\node_modules\\synchronized-promise\\node_modules\\deasync\\build',
    npm error gyp info spawn args '-Goutput_dir=.'
    npm error gyp info spawn args ]
    npm error <string>:25: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
    npm error gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
    npm error gyp info spawn args [
    npm error gyp info spawn args 'build/binding.sln',
    npm error gyp info spawn args '/clp:Verbosity=minimal',
    npm error gyp info spawn args '/nologo',
    npm error gyp info spawn args '/nodeReuse:false',
    npm error gyp info spawn args '/p:Configuration=Release;Platform=x64'
    npm error gyp info spawn args ]
    npm error gyp ERR! build error
    npm error gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
    npm error gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\node-gyp\lib\build.js:219:23)
    npm error gyp ERR! stack at ChildProcess.emit (node:events:508:20)
    npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
    npm error gyp ERR! System Windows_NT 10.0.26200
    npm error gyp ERR! command "C:\\Users\\Brandon\\AppData\\Local\\fnm_multishells\\23752_1773569444215\\node.exe" "C:\\Users\\Brandon\\AppData\\Local\\fnm_multishells\\23752_1773569444215\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
    npm error gyp ERR! cwd C:\Users\Brandon\AppData\Roaming\fnm\node-versions\v25.6.1\installation\node_modules\synchronized-promise\node_modules\deasync
    npm error gyp ERR! node -v v25.6.1
    npm error gyp ERR! node-gyp -v v12.2.0
    npm error gyp ERR! $npm_package_name deasync
    npm error gyp ERR! $npm_package_version 0.1.31
    npm error gyp ERR! not ok
    npm error Build failed
    npm error A complete log of this run can be found in: C:\Users\Brandon\AppData\Local\npm-cache\_logs\2026-03-15T10_10_42_667Z-debug-0.log
    
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