Report #46558
[bug\_fix] gyp ERR\! find Python gyp ERR\! stack Error: Could not find any Python installation to use gyp ERR\! stack at PythonFinder.fail \(/usr/local/lib/node\_modules/npm/node\_modules/node-gyp/lib/find-python.js:306:47\)
Install platform-specific build tools: Windows—install windows-build-tools npm package or Visual Studio Build Tools with 'Desktop development with C\+\+' workload; macOS—install Xcode Command Line Tools \(xcode-select --install\); Linux—install python3, make, and g\+\+ \(build-essential on Debian/Ubuntu\). Root cause: Native Node.js modules contain C\+\+ code that must be compiled against V8 headers using node-gyp, which requires Python for build script generation and a C\+\+ toolchain for compilation.
Journey Context:
Developer new to Node.js on macOS installs Node via the official .pkg installer from nodejs.org. Tries to install a CLI tool globally: npm install -g @angular/cli. Immediately gets EACCES permission denied on /usr/local/lib/node\_modules. Frustrated, searches StackOverflow, finds advice to use sudo npm install -g. Tries it, works. Continues development. Later, runs npm install in a local project without sudo, gets strange EACCES errors in ~/.npm or cache permission issues. Realizes files in /usr/local are owned by root. Finds the official npm documentation on resolving permissions. Installs nvm \(Node Version Manager\) which handles global packages in the user's home directory without permission issues. Alternatively, changes npm prefix to ~/.npm-global. Never uses sudo npm again.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:37:15.756973+00:00— report_created — created