Install OpenWhisk CLI on mac - openwhisk

I am unable to install OpenWhisk command line for some reason. I download the CLI and double click to run it. I see a terminal window saying
[Process Complete]
But then it says
-bash: wsk: command not found

The OpenWhisk command line is not an installer but rather the binary itself. Open your Terminal.app, navigate to the folder you downloaded the binary to (like cd ~/Downloads) and use the binary from there, for example ./wsk action list.
To be able to use the binary from everywhere, you'll have to make sure its in the PATH. To achieve that, either alter your PATH to include the folder where wsk is located or copy the binary to a folder already contained in your path like /usr/local/bin.

Download wsk cli from here.
Go to downloads folder and modify permissions for wsk file using terminal
$ chmod +x ./wsk
Move wsk to use/local/bin folder using terminal. This will add wsk to the PATH
$ sudo mv wsk /usr/local/bin
Test this using following command:
$ wsk --help

Try ./wsk,
if that works, you can update your path: PATH = $PATH:. then just use the wsk.

If you're using Homebrew, I added a tap so you can easily install the wsk binary from a MacOS terminal: https://github.com/shaftoe/homebrew-wsk
brew install shaftoe/wsk/wsk

You can download the binary from the below url and then use .wsk from the folder where you place this binary into.
https://openwhisk.ng.bluemix.net/cli/go/download/mac/

Related

How to install Fly CLI to mac

I download the latest version of the Fly cli
https://concourse-ci.org/download.html
to ~/Downloads then cd to ~/Downloads
cd ~/Downloads
mv fly_darwin_amd64 fly
install fly
then I do
fly
and i get
-bash: fly: command not found
Is one of my steps wrong?
Try
cd ~/Downloads
mv fly_darwin_amd64 /usr/local/bin/fly
chmod 0700 /usr/local/bin/fly (Thanks to #Andrew Ramnikov)
For the newest mac os version, you need to allow the App to run from System Settings->Security and Privacy->General-> Allow app
fly -version
On MacOS, you can install with brew like, brew install --cask fly.
You might also want to install CredHub to manage credentials, brew install cloudfoundry/tap/credhub-cli.
Note that in the accepted answer, in Catalina and Newer the equivalent to the last step to allow the app in privacy settings is: xattr -d com.apple.quarantine /usr/local/bin/fly
And this does not require admin rights, but doing it via the GUI does.
Go to System Preferences -> Security & Privacy -> General and click allow anyway next the the fly app.
I ended up moving the fly binary to a folder in my home directory, and just added it to my path variable in ~/.bash_profile so I guess it works now.
edit
However, when I do
fly -t main login
I get
error: unknown target: main
easiest way is to run first command curl 'http://localhost:8080/api/v1/cli?arch=amd64&platform=darwin' -o fly \ && chmod +x ./fly which will create a fly binary and for the second part of command just do it manually && mv ./fly /usr/local/bin/ meaning you need to copy fly binary into /usr/local/bin

Installing Julia v0.5 on Ubuntu 16.04 while v0.6 is installed

I use v0.6, but certain packages do not function with v0.6 (such as Interact.jl). How can I install v0.5? I am running Ubuntu 16.04.
First we have to download the latest Julia version from https://julialang.org/downloads/
I used the “Generic Linux Binaries for x86” version. The choice between x86 and ARM depends on the processor of your machine. Also choose between 32 bit and 64 bit versions based on the operating system and processor you have on your machine.
After download, you will get a compressed tar.gz archive having name similar to “julia-0.6.2-linux-x86_64.tar.gz”. As the “julia-0.6.2-linux-x86_64.tar.gz” name suggests that I downloaded the Julia version 0.6.2 which is latest at the time of writing this.
The names may differ. Adapt the names accordingly.
Remember these are binaries, these don't need to be installed as they can be directly used from the directory they are extracted.
I am assuming that the downloaded file is in your ~/Downloads directory of Ubuntu.
Open the terminal and navigate to the directory where the downloaded tar.gz file is stored, in present case the Downloads directory.
The terminal when just opened will show:
x#xpc:~$
where x should be replaced by your username and xpc should be replaced by your computer name.
Navigate to the Downloads directory using cd Downloads and then press Enter to get following terminal:
x#xpc:~/Downloads $
Extract the tar.gz file using the command
tar -zxvf julia-0.6.2-linux-x86_64.tar.gz
Now a directory with extracted contents will be generated in the same parent directory as of the compressed archive with a name similar to julia-xxxxxxxxxx where xxxxxxxxxx may be a combination of alphabets and numerals.
This is the final directory you need to run the latest Julia version, no installation is needed.
To run Julia, you can directly run using the julia file in location julia-xxxxxxxxxx/bin/julia as discussed below.
Navigate to the bin directory in the extracted directory using
cd /Downloads/julia-xxxxxxxxxx/bin
The terminal will now be like:
x#xpc:~/Downloads/julia-xxxxxxxxxx/bin $
Now run the command ./julia to run julia on the terminal as shown below.
The terminal will now change to julia as presented below. I know the representation is little different here as this is all I can manage to copy from the terminal to present it to you.
julia>
But the problem is that I have to navigate to the directory every time to run Julia.
Many people have discussed on the internet about defining the path and alias through very complex procedures and as I am not a hardcore computer geek, it was really difficult for me to understand.
I came to know about making a soft link.
So I decided to make a soft link to the Julia to run it directly from anywhere with a short command without navigating to the directory containing it.
I always try to do things neatly, so I decided to keep the extracted directory named julia-xxxxxxxxxx in the /opt directory of my system as most of my important programs reside in that.
You need root permissions to copy a file into the /opt directory, so I used the command sudo su and then provided password to get the super user privileges:
x#xpc:~$ sudo su
[sudo] password for x:
root#xpc:/home/x#
Now navigate to the directory presently containing the extracted directory:
root#xpc:/home/x# cd /Downloads/
root#xpc:/home/x/Downloads#
Copy the directory using:
root#xpc:/home/x/Downloads# cp -r julia-xxxxxxxxxx /opt
After the directory is copied to the destination, now we will make the soft link in a directory which is in the system path so that the soft-link can be called from any location to run Julia.
To find out the directories in the system PATH use echo $PATH, you will get a list of paths of directories separated by colon(:) such as /usr/local/bin. You can use any of them. I used /usr/local/bin for the soft link.
Navigate to the chosen folder.
root#xpc:/home/x# cd /usr/local/bin
The terminal will become
root#xpc:/home/x/usr/local/bin#
Create the soft link using
root#xpc:/home/x/usr/local/bin# sudo ln -s /opt/julia-xxxxxxxxxx/bin/julia julia
Now return to the normal user terminal using the keyboard combination Ctrl+D at the empty terminal root#xpc:/home/x/usr/local/bin#.
The terminal prompt will become:
x#xpc:~$
Type the newly made soft link i.e. julia in the terminal as shown below
x#xpc:~$ julia
This is where the magic happens and you get this:
julia>
The instructions can be used for any version of Julia in Ubuntu.
Source
Firstly, you should really read the post that Reza Afzalan linked. It gives you everything you need to know about how to install. If you prefer a list:
Go to the Julia download page.
Download the Generic Linux Binary for your OS (probably 64-bit for Ubuntu 16).
Install it.
Find where the installed Julia binary executables are stored on your machine.
Symlink Julia v0.5 and Julia v0.6 to different aliases, e.g. julia5 and julia6. You can store the symlinks in a directory like /usr/local/bin.
Open julia5.
Start downloading your packages with Pkg.add.
It's very easy, here's how to install it on Linux in 8 steps:
1- go to Julia downloads page
2- Choose you version (32bit or 64bit) from Generic Linux Binaries, and then download it.
3- extract .tar.gz file in home or any place you would like to install Julia on it.
4- run > gksudo gedit /etc/environment on your terminal to setup envirnment path.
5- edit file :/Path_To_extracted_File/bin in my case it was like this:
":/home/okasha/julia-d386e40c17/bin"
6- Save edits and close the file.
7- Restart your machine.
8- Open your terminal again and run > julia -version
you shoud get "julia version 0.6.2" for Example according to your installed julia version.
Run > julia to open julia session.
Reference
Just type this
sudo apt install julia

MINGW64 "make build" error: "bash: make: command not found"

I am working on Windows 10. I want to run a "make build" in MINGW64 but following error comes up:
$ make build
bash: make: command not found
I want to build Glide for Golang
I tried following:
$ sudo yum install build-essential
bash: sudo: command not found
As well as:
$ yum install build-essential
bash: yum: command not found
And:
$ apt-cyg build-essential
bash: apt-cyg: command not found
How can I "work-around" this problem?
Go to ezwinports, https://sourceforge.net/projects/ezwinports/files/
Download make-4.2.1-without-guile-w32-bin.zip (get the version
without guile)
Extract zip
Copy the contents to C:\ProgramFiles\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.
You can also use Chocolatey.
Having it installed, just run:
choco install make
When it finishes, it is installed and available in Git for Bash / MinGW.
You have to install mingw-get and after that you can run mingw-get install msys-make to have the command make available.
Here is a link for what you want http://www.mingw.org/wiki/getting_started
We can't use the 'make' command on windows and we don't get it preinstalled with MINGW. So to use it, you need to download it first. The steps are as follows-
Go to https://sourceforge.net/projects/mingw/postdownload and download it.
After the installation is over, go and check if bin folder is present in the directory of MINGW .
If everything works well till now, change the environment variables- go to settings of your laptop and type Environment variables. Go to it's section and click on 'environment variables' at the end.
On the section where 'path' is written, add a new file - the location of the bin file and save.
Install make by typing the following on mingw command line :
mingw-get install mingw32-make
Now make is installed. To use it in command line just write "mingw32-make" in place of "make".
Try using cmake itself.
In the build directory, run:
cmake --build .
Go to downloads of jmeubank.github.io/tdm/gcc : https://jmeubank.github.io/tdm-gcc/download/
Download 64+32-bit MinGW-w64 edition.
Run the .exe file.
Click on Remove if you have tdm-gcc already.
Then Click on Create to install tdm-gcc.
Complete the installation.
Add path to environment variable if not added automatically.
Now run mingw32-make on your terminal / command prompt.
Hope this works
You have to install make first. Run any of the below commands and it will work.
pip install make
OR
conda install make

firebase-tools "-bash: firebase: command not found"

Excited that Firebase's hosting is now out of beta. Trying to get going with with the firebase-tools package and I've successfully installed it:
npm install -g firebase-tools
Trying to run any tool fails with
-bash: firebase: command not found
I've tried putting the following command in my .bash_profile without any luck
export PATH=/usr/local/share/npm/bin:$PATH
Any ideas? Pretty new to the command line in general.
Thanks!
Run code below with terminal,
alias firebase="`npm config get prefix`/bin/firebase"
Installing firebase-tools globally did the trick for me :
npm install -g firebase-tools
You should add the npm bin folder to your bash PATH variable. To do that, run:
npm get prefix
And it should output something like /home/your-username/npm-global or /home/your-username/npm-packages.
Then in your ~/.bashrc or ~/.bash_profile (if you're in a Mac) file, add:
export PATH="/home/your-username/npm-global/bin:$PATH" # Add npm bin PATH
Note the "/bin" after the npm get prefix result.
#mklement0 That answer looks good, but I'm worried it will be intimidating to someone who is so new to the command line. So I'm going to cherry-pick the most relevant piece of it.
#cienki Run this command to see what you should be putting in that PATH prefix in your .bash_profile file:
npm get prefix
by chance if you are using macOS with m1 chip
arch -x86_64 npm i -g firebase-tools
assuming that you haven't set the PATH
export PATH="`npm config get prefix`/bin:$PATH"
That's all and enjoy
On macOS: Use
curl -sL firebase.tools | upgrade=true bash
It worked for me
firebase -V
Using Windows 10, Bash
This worked for me:
npm get prefix // to find Path which for me it was C:\Users\User\AppData\Roaming\npm
search "Environment Variables" which located in "System Properties".
Under "System Variables", find the PATH variable, select it, and click "Edit". Click "New" and add the path found with the "npm get prefix" command earlier (which was for me C:\Users\User\AppData\Roaming\npm)
Then click "Ok"
Restart Bash
firebase --version //to check firebase version
Bruno's answer did the trick, I only needed to add a dot at npm-global in Ubuntu in .bashrc:
export PATH="/home/your-username/.npm-global/bin:$PATH" # Add npm bin PATH
Below command works for me on terminal
curl -sL firebase.tools | upgrade=true bash
This command install firebase tool for me
After installing:
$ npm install -g firebase-tools
$ firebase init
-bash: firebase: command not found
"If you are getting the above output then follow the below steps:"
For Windows Users:
type this cmd :
$ npm get prefix
C:\Users\Jeet\AppData\Roaming\npm [this is the location]
Now you have to set in enviorenment variable -> (windows+r) -> sysdm.cpl -> Advanced(tab) -> Environment Variables
-> under the System Variables -> click on path -> edit -> C:\Users\Jeet\AppData\Roaming\npm [paste] the above location -> apply - ok - ok.
Restart your bash terminal
Thanks!!!
For Mac OS Sierra:
$ sudo npm install -g firebase-tools
To stop other Node process use $ ps aux | grep node
If needed to upgrade or install emulator - $ npm install -g #google-cloud/functions-emulator
Ready to go $ firebase --version
For anyone using MacOS Catalina 10.15.2 getting the bash PATH variable fixed the issue for me.
Run:
npm get prefix
Then run:
export PATH=/Users/userid/.npm-global/bin:$PATH
Note: I recently upgraded from my old High Sierra MacBook Pro, and was confused as well.
For anyone using nvm the error could arise because you are on a different nvm version than you were on when you first installed firebase tools globally. That's what it was for me. When I restarted webstorm nvm switched to a different version.
Run nvm list to check the version you are on and run nvm use x.x.x to switch to the right version where you installed firebase tools originally.
This worked for me on Mac (same thing the others have been posting above, just for Mac):
go to your home folder in Finder (named after your user name, in my case "macbook")
press cmd+shift+dot (will reveal hidden files)
go the .npm-global/bin folder and copy its path (Finder menu -> View -> Show Path Bar, right click on the bin folder in the path bar -> "Copy 'bin' as Pathname")
open Terminal (by default the home folder) and go nano ~/.bash_profile
at the top of the file add export PATH="<cmd+v>:$PATH" (will look similar to this: export PATH="/Users/macbook/.npm-global/bin:$PATH")
save .bash_profile changes and restart Terminal, firebase command should work now
if you installing firebase-tools using
yarn global add firebase-tools
i got same error then i got answer and execute this
export PATH="$(yarn global bin):$PATH"
and then i can do firebase login pretty well
I am on Linux and installing the package with admin privileges resolved the problem:
sudo npm i -g firebase-tools
Simply reinstall node.js. This worked for me and fire command was recognized.
You forgot sudo type this
sudo npm install -g firebase-tools
problem solved.
I know most answers work for all generic 'command not found' errors. Basically by manually setting PATH variable but there's an easier way for this specific problem relating 'firebase command not found':
Try this cURL command and it will fix this issue for good and will minimise any user errors.
Install the Firebase CLI using the automatic install script
Run the following cURL command (Mac or Windows):
curl -sL https://firebase.tools | bash
Source: https://firebase.google.com/docs/cli#install-cli-windows, https://firebase.google.com/docs/cli#install-cli-mac-linux
This is for updated mac mac Os Catalina(10.15.1+) & on zsh.
Go to Terminal (vim .zprofile)
add this export PATH="/Users/Your Username/.npm-global/bin:$PATH"
Works for me!
Faced the same issue, am a newbie backend guy.
Used npm install firebase-tools
It doesn't install and you can't run.
I tried looking at the forums and here's what worked for me:
sudo npm install -g firebase-tools.
Then it asks for Permissions when you firebase login.
Am using Ubuntu.
After trying pretty much everything, only one worked for me (I'm on MacOs Catalina):
Try the following in your terminal:
curl -sL https://firebase.tools | bash
This will check the OS of your machine and then install everything else automatically and properly.
The command is from the official Firebase Documentation.
https://stackoverflow.com/a/60474459/1245341
After installing
$ npm install -g firebase-tools
Note the directory where it istalled What I did was locate the directory where firebase was installed. In my case C:\usr\local then I copied the three firebase files. I also went into the node_modules folder and copied the firebase tools folder. Then I went to my app directory in file manager and pasted the firebase files, then created a new node_modules folder and pasted the firebase-tools folder.
Now go to your cmd and run
$ firebase init
It should work
I tried a lot of things from here and from other forums, but what ended up working for me (and this is more of a work-around) was to download the binary and then open it and it set up all the firebase stuff for me.
However, I found that if I moved it after opening it once, it did not work. So first move it to wherever you want to leave it and then run the .exe.
This allowed me to skip configuring the PATH variable which was nice.
I'm on a Windows 10 Pro Education. Hope this helps someone who has a similar struggle.
Adding to Durul Dalkanat's answer,
Assuming you have executed npm install firebase-tools -g
Firstly get the output of the command of npm get prefix.
Open .bashrc file which is in the home directory and add alias <output of npm get prefix>/bin/firebase at the end of the file.
Run source .bashrc in the home directory.
Enjoy!
The alias of firebase will be the actual firebase path in the main system and this solution should work flawlessly.
if you're windows 8 user, one possible solution is to put the PATH in environment variables manualy...
On the Windows desktop, right-click My Computer.
In the pop-up menu, click Properties.
In the System Properties window, click the Advanced tab, and then click Environment Variables.
In the System Variables window, highlight Path, and click Edit.
In the Edit System Variables window, insert the cursor at the end of the Variable value field.
If the last character is not a semi-colon (;), add one.
After the final semi-colon, type the full path to the file you want to find.
For me it was: C:\Users\ 'username' \AppData\Roaming\npm
To get your path put this string in you command line:
$ npm get prefix
Click OK in each open window
I tried all the answers above, other SO answers, and GitHub answers but nothing worked. The only thing that worked for me was to save whatever was inside my index.js file temporarily somewhere else, delete the entire cloud functions folder, then reinstall and start everything from the very beginning.
After many hours trying everything the only thing what helped (on windows) was downloading and installing node again.
I found a solution.
npm i express firebase-tools
If you are admin on your PC, installing firebase and firebase-tools with -g flag should resolve the issue (the path will added to the global PATH variable) but if you are an admin, you may have to add that path yourself.
Seeking help from one of the top answer, issue this command will return the path where firebase is installed
npm config get prefix /bin/firebase
In my case the following is returned.
C:\Users\*user_name*\AppData\Roaming\npm
Copy that path (from first line) and visit this page on how to update path variable (Window + x then visit systems > Advance Settings). Here add a new entry in path and past that path there. Firebase command should work from command prompt every time without the use of alias required.

Is it possible to use firefox's google search bar directly from command line?

I checked through firefox's supposedly supported command line arguments and found this distinctly lacking, but I can't help but assume it must be somehow possible. Any thoughts on how? Currently running Ubuntu 11.10 if that changes anything.
If you're talking about the Developer Toolbar, it doesn't look like that has access to the built-in search. It's mainly for quick access to developer tasks (type help to see the full range of what it accesses), not for driving regular browsing tasks.
install googler using terminal in ubuntu
Step-1 : Install git(if not installed)
sudo apt-get install git
Step-2: Change the directory
cd /tmp
Step-3: Clone it from link given below using command
git clone https://github.com/jarun/googler.git
Step-4: get into googler directory
cd googler
Step-5:
sudo make install
Step-6:After that move to bash directory
cd auto-completion/bash/
Step-7:Finally copy file into etc/bash_completion.d
sudo cp googler-completion.bash /etc/bash_completion.d/
Now from terminal open googler
googler your_query
For further query refer here
use man googler for more option

Resources