Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install error - No Xcode or CLT version detected?

"no receipt for 'com.apple.pkg.cltools_executables' found at '/'"

Above error is thrown while running 'npm install' for an angular 9 project in VS Code bash terminal for MacOS (Catalina)

Package.json dependencies:

    "@angular/animations": "~9.1.1",
    "@angular/common": "~9.1.1",
    "@angular/compiler": "~9.1.1",
    "@angular/core": "~9.1.1",
    "@angular/platform-browser": "~9.1.1",
    "@angular/platform-browser-dynamic": "~9.1.1",
    "@angular/router": "~9.1.1",
    "rxjs": "~6.5.4",
    "tslib": "1.10.0",
    "zone.js": "0.10.2"
like image 831
Anurag Chugh Avatar asked Aug 07 '20 10:08

Anurag Chugh


People also ask

What is CLT in Mac?

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.

How do I know if Xcode is installed on my Mac?

We'll use Finder to find out if XCode is installed. In Finder, select the Go pull-down menu, and select Applications. Or just use the short-cut key Command-Shift-A while Finder is active. This should open a new Finder window, showing all the Applications installed on your machine.


1 Answers

I got this working by following the steps below:

  • Find out the path for the command line tools xcode-select --print-path

  • Delete command line tools directory ( Directory path can be retrieved from the above step ) sudo rm -rf /Library/Developer/CommandLineTools

  • Run this to re-install xcode-select --install

Post this, 'npm install' should run successfully on VS Code in MacOS bash terminal.

like image 79
Anurag Chugh Avatar answered Oct 20 '22 03:10

Anurag Chugh