A solution to g++ command not found an error while installing nodejs packages.
I was installing Browsertime on CentOS 7 and encountered this error.
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz prebuild-install WARN install No prebuilt binaries found (target=11.15.0 runtime=node arch=x64 libc= platform=linux) make: Entering directory `/usr/lib/node_modules/browsertime/node_modules/sharp/build' TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o make: g++: Command not found make: *** [Release/obj.target/sharp/src/common.o] Error 127 make: Leaving directory `/usr/lib/node_modules/browsertime/node_modules/sharp/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2
Well, this could happen with any package which uses
g++ library. To fix this error, all you got to do is install development tools with
yum as below command.
yum groupinstall 'Development Tools'
Try to install what you were installing. It worked for me, and I hope for you too.
- Tagged in:
More great readings on Sysadmin
SQL Server Management Studio (SSMS): Everything to Know in 2022Satish Shethi on June 16, 2022
Looking For Traceroute on RHEL 8? Try TracepathAbhishek Nair on June 14, 2022
6 Best Switch Port Monitoring ToolsDurga Prasad Acharya on June 12, 2022
Windows 10/11 Random Shutdown: How to Find the CauseHitesh Sant on May 30, 2022
7 Best Server Configuration Monitoring and Auditing ToolsTalha Khalid on May 28, 2022
8 Best FTP Server Software for Windows for Secure TransferSatish Shethi on May 24, 2022
Join Geekflare Newsletter
Every week we share trending articles and tools in our newsletter. More than 10,000 people enjoy reading, and you will love it too.