We can get macOS “Command Line Tools for Xcode” from the Developer section of the Apple website. For this, just browse to the developer.apple.com page, find the latest version of the “Command Line Tools for Xcode” and download it to your computer. At the time of this writing, the latest version of the “Command Line Tools for Xcode” is 11.3.1. Sep 04, 2020 Tilde vs Caret (^) in package.json file How to completely uninstall and re-install Node.js and npm in Mac OS How to solve the Cannot use import statement outside a module How to get the full URL in Express How to solve the npm WARN package.json: No repository field.
Recently, when attempting to install the
gulp
package using the npm
CLI (“Node package manager”, “Command line interface”) in the Terminal app, I saw an error message saying that node-gyp
rebuild is failed because no Xcode or CLT version detected
. In this tutorial, you’ll learn how to solve this problem.What causes this error
![How To Fix %24path For Gulp Node On Mac How To Fix %24path For Gulp Node On Mac](/uploads/1/1/7/9/117908833/739556738.jpg)
In my case, the below error appeared when attempting to install the
gulp
package using the npm
CLI (“Node package manager”, “Command line interface”) in the Terminal app.The error message above is self explanatory. It saying that the
node-gyp
rebuild is failed, and this is because No Xcode or CLT version detected
.- Xcode is an integrated development environment (IDE) for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iPadOS, iOS, watchOS, and tvOS.
- The CLT stands for “Command Line Tools for Xcode”. This package enables UNIX-style development via Terminal by installing command line developer tools, as well as macOS SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make. If you use Xcode, these tools are also embedded within the Xcode IDE.
This is strange because I am sure that the “Command Line Tools for Xcode” is installed on my Mac; I already used these tools, and before everything was fine. In my case, this error appeared after upgrading macOS to version 10.15 called “Catalina”. Therefore I thought that maybe there is some kind of problem with paths in my “Command Line Tools for Xcode” installation after upgrading macOS to Catalina, and I just need to reinstall the “Command Line Tools for Xcode” on my Mac to solve the problem.
Now we know what caused this error.
How to solve it
Once we know what is causing the
node-gyp
rebuild to fail, we can use it to solve the problem. It is a really easy process. To solve this problem, we need to manually download and install the macOS “Command Line Tools for Xcode”. Now, step by step guide.We can get macOS “Command Line Tools for Xcode” from the Developer section of the Apple website. For this, just browse to the developer.apple.com page, find the latest version of the “Command Line Tools for Xcode” and download it to your computer.
Note! At the time of this writing, the latest version of the “Command Line Tools for Xcode” is 11.3.1.
macOS “Command Line Tools for Xcode” (im my case version is 11.3.1) download directly to our Downloads folder as an DMG image file named
Command_Line_Tools_for_Xcode_11.3.1.dmg
.- A DMG file is a mountable disk image used to distribute software to the macOS operating system. Today, software developers typically build and distribute applications for macOS as DMG. In other words, DMG files are containers for apps in macOS.
Now we can install the “Command Line Tools for Xcode” using the file downloaded in the previous step. For this, just double-click on the
Command_Line_Tools_for_Xcode_11.3.1.dmg
file to mount it, then double-click on the Command_Line_Tools.pkg
file in the window that opens to launch the installation wizard, and follow the installation wizard instructions.Finally, we can try to install a package and verify that it installs without the
node-gyp
rebuild error.Launch the Terminal app from the Utilities folder of your Applications folder, or use Spotlight to find it.
Type the following command and press the
Enter
key to install a package (in this example gulp
will be installed).Let the command line do its work and don’t interrupt it until you see the final line that says about how many packages were added and updated. This can take a while, so be patient.
No errors. It works!
Conclusion
That’s it, you’re done. Now the
npm
should install a packages without the node-gyp
rebuild error. So simple isn’t it?If you are having trouble fixing this problem with the instructions above, but are being able to solve this problem with any another method please describe it in the comment section below. Thanks!
How To Fix 24path For Gulp Node On Mac Windows 10
![How to fix 24path for gulp node on mac windows 10 How to fix 24path for gulp node on mac windows 10](/uploads/1/1/7/9/117908833/378104595.jpg)
I hope this article has helped you learn how to fix the
node-gyp
rebuild error. If this article helped you then please leave a commentThanks for reading!
Arthur is a designer and full stack software engineer. He is the founder of Space X-Chimp and the blog My Cyber Universe. His personal website can be found at arthurgareginyan.com.
How To Fix 24path For Gulp Node On Mac Computer
Follow Arthur