Problem with Update-alternatives for java - nativescript-vue

I try to setup nativescript-vue on linux by following steps on nativescript website. when I use this command
sudo update-alternatives --config java
but have an error
update-alternatives: error: no alternatives for java
Please tell me how to fix this problem......

Try
sudo update-alternatives --install /usr/bin/java java path_to_java 1
In my case the path was /usr/lib/jvm/java-8-openjdk-amd64

Do you have java installed?
Check if you do by running java -version in the command line/terminal

Related

session-manager plugin on amazon linux 2 not found

Following the docs for installing the session-manager-plugin:
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
On Amazon linux 2:
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"
sudo yum install -y session-manager-plugin.rpm
session-manager-plugin
bash: session-manager-plugin: command not found
The command is probably not in your path. Try /usr/local/bin/session-manager-plugin.

-bash: ask: command not found

I have mac and was trying to install Alexa cli with below command:
sudo npm install -g ask-cli
My installation was showing successful but it was giving me below error on ask --version :
-bash: ask: command not found
I am using node version > 12
Can any one help ?
I googled lot but could not found the answer. Got frustrated. So
finally thought of putting.
I have mac and was trying to install Alexa cli with below command:
sudo npm install -g ask-cli
My installation was showing successful but it was giving me below error on ask --version :
-bash: ask: command not found
I was using node version > 12
Finally after almost 6 hours of RnD i could solve this error by downgrading node to version 8
Below are the detailes what i did:
THis was my prev version which was giving error
Anands-MacBook-Air:~ anand$ node -v
v13.6.0
How to downgrade to lower version of node :
Anands-MacBook-Air:~ anand$ sudo npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
Anands-MacBook-Air:~ anand$ sudo npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n#6.1.3
updated 1 package in 27.206s
Anands-MacBook-Air:~ anand$ sudo n 8 5.8
installing : node-v8.17.0
mkdir : /usr/local/n/versions/node/8.17.0
fetch : https://nodejs.org/dist/v8.17.0/node-v8.17.0-darwin-x64.tar.gz
installed : v8.17.0 (with npm 6.13.4)
Anands-MacBook-Air:~ anand$ node -v
v8.17.0
Then did below :
Anands-MacBook-Air:~ anand$ sudo npm install -g ask-cli
Anands-MacBook-Air:~ anand$ ask --version
1.7.22
Anands-MacBook-Air:~ anand$
Hope it will help someone.
If you use nvm, you might need to install it on your current Node.js version.
Exiting out of the terminal session and opening up a new terminal session solved this for me on MacOS.

-bash: aws: command not found

I'm on macOS Mojave Version 10.14.5.
I was following the instructions here
Installing the AWS CLI
when I got to the part to type
aws --version
in terminal, and got the response
-bash: aws: command not found
Here's a screenshot of terminal
I looked at the other posts similar to this on stackoverflow, but they seem to apply to different contexts. They have not helped.
you need to install python and pip on your mac in order to install the awscli.
After the installation of python and pip, please use following command to install aws cli with latest version from AWS.
sudo pip install awscli --force-reinstall --upgrade
Install python version 3 or higher And Use this command to download aws cli with python3
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo /usr/local/bin/python3 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
use AWS official guide here to ensure you are installing the latest version.
I have mac and this fixed the issue
$ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
$ sudo installer -pkg AWSCLIV2.pkg -target /
This command works good for me
sudo apt install awscli

command 'sam' not found using sudo

I have installed sam using following
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html
I can run following
sam build
But not
sudo sam build
which gives me => sudo: sam: command not found
Further going I have found that I need to sudo permission to sudo as follows.
sudo env "PATH=/home/linuxbrew/.linuxbrew/bin/sam" sam
Is the above correct? I haven't run this command and not sure if it is proper.
This is what I have run.
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
You can try this:
In a normal terminal (normal user):
which sam
This will give you the location, where sam is installed, let's say /somewhere/bin/sam.
Then: try:
sudo /somewhere/bin/sam build
if you followed the tutorial about Linux+Brew+SAM install, maybe you forgot to run the command:
brew install aws-sam-cli
Or just make an alias to the command
nano ~/.bashrc
add row at the end
alias sam='/home/linuxbrew/.linuxbrew/bin/sam'
Save. Restart terminal.
pip3 install aws-sam-cli
this worked for me.
Run the below command after following the official aws sam cli installation tutorial
$ brew install aws-sam-cli
==> Installing aws-sam-cli from aws/tap
==> Downloading https://github.com/aws/aws-sam-🍺
...
/home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/1.13.2: 3,899 files, 91MB
At the end it will show where it would be installed.
for me it is the path
/home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/1.13.2/libexec/bin/sam
then make a symbolic link
$ ln -s /home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/1.13.2/libexec/bin/sam /home/linuxbrew/.linuxbrew/bin/sam
now you will be able to call sam easily
$ sam --version
SAM CLI, version 1.13.2

Deploy Django app on heroku. Who has suceeded?

When I launch command line:
$ pip install -r requirements.txt
The following error shows:
command 'gcc-4.0' failed with exit status 1
Why? Thanks!
If not already done, installing gcc >= 4.0 on your system might help.
Are you trying to install the requirements manually? That automatically happens when you deploy to Heroku, as long as you have a requirements.txt file in the root of the repo.
I had this same problem. The issue was that pip was looking for gcc in the /Developer folder, which does not exist on my system. I ended up creating the folder that pip was looking for (/Developer/usr/bin) and adding a symbolic link to /usr/bin/gcc in this new folder. The command to do this is ln -s /usr/bin/gcc gcc. In your case, you can replace gcc with gcc-4.0. I hope this helps.
You can find some more information here: gcc-4.2 error when using pip in virtualenv on OSX 10.7.