- Install the build tools
xcode-select --installA window pops up. Click Install. Already installed? It says so and you can move on.
- Update npm, which brings a newer node-gyp
npm install -g npm@latestThis fixes "No module named distutils", which older node-gyp versions hit with newer Python.
- Reinstall the project's packages
rm -rf node_modules && npm install
Check it worked
- Check node-gyp can find what it needs
npx node-gyp --version && python3 --version && clang --version
- Install the build tools and PythonNeeds sudo
sudo apt install -y build-essential python3On Fedora: sudo dnf group install development-tools, then sudo dnf install python3.
- Update npm, which brings a newer node-gyp
npm install -g npm@latestThis fixes "No module named distutils", which older node-gyp versions hit with newer Python.
- Reinstall the project's packages
rm -rf node_modules && npm install
Check it worked
- Check node-gyp can find what it needs
npx node-gyp --version && python3 --version && gcc --version
- Install the Visual Studio C++ build tools
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"About 5 GB. This is what "gyp ERR! find VS" is asking for.
- Install Python
winget install Python.Python.3.12Close and reopen PowerShell afterwards so it can find Python.
- Update npm, which brings a newer node-gyp
npm install -g npm@latest - Reinstall the project's packages
Remove-Item -Recurse -Force node_modules; npm install
Check it worked
- Check node-gyp can find what it needs
npx node-gyp --version; python --version