-bash: phonegap: command not found (Mac OS) - macos

I just installed phonegap and cordova using npm on my Macbook (Mac OS X Mountain Lion) using these commands on the command line.
sudo npm install -g cordova
sudo npm install -g phonegap
Both Phonegap and cordova seemed to install fine, but when I tried:
myMac:~ user$ cordova
myMac:~ user$ phonegap
I got the messages:
-bash: cordova: command not found
-bash: phonegap: command not found
both were installed, why does the command not work.

I know that this is an old question, but I think that my answer will be helpful.
I got the same problem and solve by creating a symlink:
cd /usr/local/bin/
sudo ln -s /usr/local/Cellar/node/6.0.0/bin/phonegap phonegap
sudo ln -s /usr/local/Cellar/node/6.0.0/bin/cordova cordova
Remember to change this path /usr/local/Cellar/node/6.0.0/bin/ to yours installation folder.
[]s

Related

how to fix my vue.js error messages after deinstall xcode? [duplicate]

Every time I try npm install. I get the following error. How do I fix it?
gyp: No Xcode or CLT version detected!
I am on node -v → v8.8.0 & npm -v → v6.11.3
I tried to run it on VSCode terminal and iTerm, but both ended up getting the same error. (both are updated to the latest version). The only new thing I did is updating my macOS to the latest version (Catalina 10.15.3 today).
$ npm install Fri Mar 6 17:22:40 2020
> fsevents#1.2.11 install /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents
> node-gyp rebuild
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/synapse/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/synapse/.nvm/versions/node/v8.8.0/bin/node" "/Users/synapse/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents
gyp ERR! node -v v8.8.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN synapsefi-dev-ui#2.0.20 No repository field.
npm WARN The package country-data is included as both a dev and production dependency.
npm WARN The package react-dropzone is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules/watchpack/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Even though you have them installed (my case), but by upgrading to Catalina (10.15.*) you can get this error (my case :) ).
Therefore, simply installing wouldn't help as you will get an error that they are already installed.
Therefore you need to hopefully just (I) reset the tool or in worse case (II) uninstall and install (requires large redownload) it again (this is based on the #Dane_duPlessis's answer).
# just for а preview (not necessary)
xcode-select --print-path
# in my case it printed `/Library/Developer/CommandLineTools`
# could be useful if the path is making a problem
sudo xcode-select --switch /Library/Developer/CommandLineTools
# only for the (I) resetting case
sudo xcode-select --reset
# only for the (II) uninstalling case - the next line deletes folder returned by the `xcode-select --print-path` command
sudo rm -rf $(xcode-select --print-path)
# only for the (II) uninstalling case - install tools (again) if you don't get a default installation prompt
xcode-select --install
NOTE:
You do not need to do it per project, but only once
There was also discussion that you have to do it on every OSX update, in my case, later updating the OSX system didn't trigger this issue again
Credits to: gyp: No Xcode or CLT version detected macOS Catalina
This worked for me with macOS Catalina Version 10.15.5:
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
...
$ sudo xcode-select --reset
...
The xcode cli tools should now be accessible. No need to re-install anything.
I guess, you may have tried multiple solutions so far but if none of those solutions have worked for you yet, don't worry - I got you. :)
Non-working Solutions:
xcode-select --install didn't work for me (macOS Catalina 10.15.7) as it shows up a Software Update dialog box which says Can't install the software because it is currently not available from the Software Update Server.
I also downloaded and install Xcode Command Line Tools from Apple's download website (https://developer.apple.com/download/more/?=for%20Xcode) but the problem re-appeared somehow or may be it didn't solve it in first place and I somehow didn't notice.
sudo xcode-select --reset also didn't do the trick for me.
Someone suggested to install whole XCode. No, thank you.
Working Solution:
Here is what worked for me i.e. reinstall Xcode Command Line Tools using Software Update manually.
Check if Command Line Tools Update is mentioned in your list of softwares to be updated by using following command: softwareupdate -l
If Command Line Tools Update is not mentioned in that list, then manually make it part of the list using following command which will create a temporary file: sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Verify that the list now has the Command Line Tools mentioned by running softwareupdate -l again.
Now, press Cmd+Space to initiate Mac's Spotlight Search. Search for Software Update. Start the Software Update.
That will show you following kind of dialog for installing the Command Line Tools. Install away the update and be merry. :)
Remove the temporary file created in Step 2: sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress.
Try these commands:
sudo rm -rf $(xcode-select -print-path)
xcode-select --install
If the above didn't resolve your issue, you may have a problem with the path Xcode is installed at. Use the following to help if necessary.
sudo xcode-select --switch /Library/Developer/CommandLineTools
sudo xcode-select --reset
I was facing the same issue
I reinstalled the command line tools.
You need to find the installation directory.
xcode-select --print-path
Delete the existing installation:
sudo rm -r -f /Library/Developer/CommandLineTools
Install by running:
xcode-select --install
This worked for me
sudo xcode-select --reset
If your Mac has been upgraded to macOS Catalina (10.15), you need to install the XCode Command Line Tools by running xcode-select --install. Alternatively, if you already have the full Xcode installed, you can find them under the menuXcode → Open Developer Tool → More Developer Tools.
This happens most of the time when there is new OS updates happens.
But I found a solutions to tackle this problem. You need to follow the below steps to solve.
Reinstall command-line tools by removing the previously installed version.
step1: First, get the location of the installed command-line tools
xcode-select --print-path
the result of the above command /Library/Developer/CommandLineTools
step2: removed the folder
sudo rm -rf /Library/Developer/CommandLineTools
step3 - install again
xcode-select --install
With the reinstallation of the command line developer tools the gyp: No Xcode or CLT version detected error message should disappear when you run any yarn or npm commands from the command line.
you will need to install xcode or command line tools
Running xcode-select --install attempts an install, but fails with the following error: Can't install the software because it is not currently available from the Software Update server. Here's what worked for me.
OS: Catalina 10.15.6
Xcode-select version: 2373
NOTE: Before running all this, I already had xcode-select version 2373 installed. But removing and reinstalling fixed the issue.
uninstall xcode-select
sudo rm -rf $(xcode-select -print-path)
Go to the app store, and download XCode.
Open XCode. On initial load, it will update/install stuff. let this happen.
From Apple Developers, manually download Command Line Tools for Xcode 12
Install the CLT for Xcode 12 package.
You should now be good to go.
this happened to me when i installed node-gyp as a dependancy and ran it in a script.
once i installed it globally
npm i -g node-gyp
it worked! (big sur)
On catalina i did the following:
xcode-select --print-path
sudo rm -rf /Library/Developer/CommandLineTools
And since install command doesnt work, I had to download it from:
https://developer.apple.com/download/more/
From there install:
XCode 12
Command Line Tools for XCode 12
Post that removed existing node_modules and reinstalled through npm install. It worked.
I was getting the same error when the project required node version 10 but I had 12+
xcode-select --print-path
Above should give: /Library/Developer/CommandLineTools
sudo rm -r -f /Library/Developer/CommandLineTools
xcode-select --install
I did exactly this, my issue is gone now.
First:
xcode-select --print-path
it gave path /Library/Developer/CommandLineTools
so:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
it pops up the install window, just install and you are on your way.
Thanks Stackoverflow!
on catalina had to manually install command line tools for xcode from https://developer.apple.com/download/more/
On macOS Catalina:
Uninstall "Command Line Tools for Xcode" with command sudo rm -rf $(xcode-select --print-path);
Download "Command Line Tools for Xcode" at More Downloads for Apple Developers, then install it.
If you don't want to install the Xcode Command Line Tools at all (like in my case).
You may try to:
delete package-lock.json file and node_modules directory (if it exist)
and npm i again
it executes with some gyp warnings about No Xcode or CLI version detected, but works fine
I updated to Big Sur and receive this error when on Catalina was all ok. But I upgraded xcode and install in another folder.
To install in that folder where was all ok helped me
Run the following command with sudo to reset your command-line tools.
sudo xcode-select --reset
In my case I deleted package.lock.json and it worked, I already had xCode installed
I tried everything and nothing worked. Personally, even if the problem was gyp, it was Next that bugged. So I downgraded in my node.js version. to install next.js and return to the latest version.
None of these answers worked for me, because I had a corrupt install of XCode, once I uninstalled, npm worked again
On Monterey , I installed Xcode via AppStore not via the command line.
So Xcode was installed in the path "/Applications/Xcode.app/" ( or "/Applications/Xcodex.x.x.app" )
But xcode-select --print-path pointed to "/Library/Developer/CommandLineTools"
This command fixed
sudo xcode-select --switch /Applications/Xcode.app/
Then
npm install
npm rebuild
Every works

Can't deploy heroku on Mac OS M1

I'm new on Heroku and trying to deploy my project here. After I typed this command in the terminal: curl https://cli-assets.heroku.com/install.sh | sh
and I also typed the administrative password correctly , I got this error message: unsupported arch: arm64
The script does not support arm64 (see line 40 pf the script).
The easier option is to install via brew
brew tap heroku/brew && brew install heroku
or download the tarball for macOS (if you still prefer doing it manually)
Download the tarball macOS
tar xvf heroku-darwin-x64.tar
sudo mv heroku /usr/local/lib
cd /usr/local/bin
ln -s /usr/local/lib/heroku/bin/heroku .
heroku --help
Apple Silicon Issues
If you’re getting the following error on a machine with an Apple M1 chip, you haven’t installed or declined to install Rosetta 2.
Bad CPU type in executable
Installing Rosetta 2 resolves this issue.
If you don’t want to install Rosetta 2 on your machine, you can install the Heroku npm package globally and use your own Node binary locally. Only v16 of Node has M1 ARM support and npm isn’t the recommended install method.
ref: heroku install
brew tap heroku/brew && brew install heroku
This command doesn't work for me
==> Installing heroku from heroku/brew
Error: Your Xcode (14.0.1) is too outdated.
Please update to Xcode 14.1 (or delete it).
Xcode can be updated from the App Store.
but there is no update in theApp Store.
Try
arch -arm64 brew install heroic
Try
arch -arm64 brew install heroku

Brew Install Error Xcode alone is not sufficient on Sierra

I'm attempting to install a package on Mac OSX Serra v10.12.6 running xCode v9.1 using HomeBrew v1.3.8.
The install and error is
TS-Mac-Pro > brew install dos2unix
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install
Then I run the command
xcode-select --install
which says the command line tool package is not available from the software update server.
Which I go into xCode it shows that the command line tools are installed.
TS-Mac-Pro > xcode-select -p
/Applications/Xcode.app/Contents/Developer
Any help would be much appreciated.
Theo
I went to Apple Developer website and downloaded the Command Line Tools dmg directly. An Apple account first needs to be setup.
The Command Line Tools can be found under -
https://developer.apple.com/download/more/
Install downloaded dmg and volia - HomeBrew is back up and running.
I just fixed this issue by deleting the current install of the command line tools and reinstalling them. See commands below:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
This fixed the issue for me in the end

xcode-select error while trying to install Homebrew on macOS Sierra

While trying to install Homebrew on macOS Sierra:
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
Yes , i have solved this error by using following steps.
In your terminal write command ::  xcode-select --install
after doing step no 1 you will get one popUp , so click on install
I had the same error and the only way I could get around it was to install the Xcode command line tools manually by downloading them directly from developer.apple.com. Once installed the brew install worked without issue.
The easiest way to handle this issue is to run:
xcode-select --install
Unfortunately I can’t make comments, so I’ll post it as an answer:
If selecting the correct Xcode version for Homebrew is what you are trying to achieve, then try this:
For Xcode release:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
For Xcode beta:
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
I resolved this error by installing the latest version of Xcode.
I tried installing Command Line Tools manually, but Command Line Tools get failed while installing. Reinstalling XCode did not help at all.
So I attempted below command helped me resolve this error on Big Sur 11.2.1 (20D74)
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Error installing pear in OS X El Capitan

I try it to install pear following this instructions
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
Then I set the Path and I type in terminal pear I get this message
/usr/local/Cellar/php55/5.5.30/bin/pear: line 28: /usr/local/Cellar/php55/5.5.23/bin/php: No such file or directory
/usr/local/Cellar/php55/5.5.30/bin/pear: line 28: exec: /usr/local/Cellar/php55/5.5.23/bin/php: cannot execute: No such file or directory
Php was installed I few month ago with homebrew, I try several times and always I get the same error, there is not way to installed.
To make it consistent, you should install PHP and pear using the same method (via Homebrew), e.g.:
brew tap homebrew/science
brew install php56 pear
The correct answer (thanks to https://stackoverflow.com/a/36547172/1953740) is to install brew with --with-pear:
brew reinstall php56 --with-pear
The homebrew/science/pear package mentioned in the other comment is not the PHP package manager; it's something different.
fixing it by creating symlink,
For example, I have my php executable file in MacPorts so for me it will be like this:
sudo ln -s /opt/local/bin/php56 /usr/local/Cellar/php55/5.5.23/bin/php
PS tested on macOS Hight Sierra 10.13.3, but it will work for El Capitan too

Resources