Report #51927
[bug\_fix] node-gyp ERR\! stack Error: \`gyp\` failed with exit code: 1
Install Python 3.x and Visual Studio Build Tools \(Windows\) or Xcode Command Line Tools \(macOS\), then npm config set msvs\_version 2022. For Alpine Linux, install python3 make g\+\+. Root cause is missing C\+\+ compiler toolchain required to compile native C\+\+ addons for Node.js.
Journey Context:
You clone a project using bcrypt or sharp on a fresh Windows laptop and run npm install. It scrolls for minutes then dies with node-gyp errors about missing msbuild.exe or Python. You try npm install windows-build-tools but it's deprecated. You download Visual Studio 2022 Build Tools with "Desktop development with C\+\+" workload, install Python 3.11, then run npm config set msvs\_version 2022 and npm config set python python3.11. On macOS, you just run xcode-select --install. On Alpine Docker, you add RUN apk add --no-cache python3 make g\+\+ before npm install.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:39:13.940332+00:00— report_created — created