-bash: ask: command not found - amazon-web-services

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.

Related

Django: "bash: npm: command not found" error when installing Tailwind CSS

I'm trying to install TailwindCSS on my Django App using this tutorial, unfortunly I'm stuck at this part
$ npm init -y && npm install tailwindcss autoprefixer clean-css-cli && npx tailwindcss init -p
When I try I get back this error:
bash: npm: command not found
I've downloaded and installed node.js and when I check using npm -v it seems that I have the 8.3.1 version and with node -v I got v16.14.0.
I've tried installing again TaiwindCSS and I still get the error
bash: npm: command not found
Can somebody help me understand what I'm doing wrong?
Thank you all

-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

How to install AWS SAM Local on Ubuntu 16.04?

I am trying to install AWS SAM (Serverless Application Model) Local on Ubuntu 16.04.
I tried to install SAM Local using NPM with the following command.
npm install -g aws-sam-local
I got the following error.
Please help me to sort it out?
Installation on Ubuntu 16.04/18.04
sudo apt-get install python3-pip -y
sudo -H python3 -m pip install aws-sam-cli
First try
npm config set unsafe-perm=true
I also installed node v8.11.1
The standard shebang for node is #!/usr/bin/env node. There is a package conflict with the name node, so it's named nodejs.
You can solve the issue with a symlink using alternatives.
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
first try
npm install -g go-npm
then
npm install -g aws-sam-local
If issue with current user permissions, please use sudo with below commands
First try,
npm config set unsafe-perm=true
Then,
npm install -g go-npm
finally,
npm install -g aws-sam-local
It will also work for mac.

installing php-imap on amazon ec2 linux 2

I need to install php-imap on amazon ec2 linux 2 instance.
All the php stuff is inside amzn2extra-lamp-mariadb10.2-php7.2 but php-imap package is missing.
Any advice ?
Thanks
I installed it like this.
I downloaded the php source code of the currently installed version in my Amazon Linux 2
wget http://php.net/get/php-7.2.8.tar.bz2/from/a/mirror
Unpacked it and went into php-7.2.8/ext/imap/
Compiled extension:
phpize
./configure
I got some errors.
Some U8T_CANONICAL stuff so
sudo yum install libc-client-devel
Then libc-client.a not found so created a symlink for it:
cd /usr/lib
sudo ln -s /usr/lib64/libc-client.a
some other imap library error so:
sudo yum install uw-imap-static
I got some other errors so the working configure line was:
./configure --with-kerberos --with-imap-ssl
make
SUCCESS!
cd php-7.2.8/ext/imap/modules
sudo cp imap.so /usr/lib64/php/modules/
Created an ini file to load it:
sudo vi /etc/php.d/30-imap.ini
added to the file this content:
extension=imap
restarted php service (you might need to restart httpd depending on your php installation):
sudo systemctl restart php-fpm
PHPinfo now contains:
imap
IMAP c-Client Version 2007f
SSL Support enabled
Kerberos Support enabled
For those who are facing the U8T_CANONICAL error and can't being able to install the libc-client-devel on Amazon Linux 2 AMI need to do something extra to resolve the U8T_CANONICAL error.
The main problem is that libc-client-devel isn't available so we need to do it in another way.
I found this link while searching for my problem. The solution that is posted here is solid. The following link that i gave is for those who are not being able to install the libc-client-devel will be benifited from the link.
Or you could just copy paste the commands i'm giving below.
1 - sudo yum groupinstall "Development Tools"
2 - sudo amazon-linux-extras install epel
3 - yum install epel-release
4 - sudo yum install libc-client-devel uw-imap-static openssl-devel
5 - sudo ln -s /usr/lib64/libc-client.a /usr/lib
The rest can be followed from respondent.
Again thanks to the person who answered.
Same problem here.
I came from debian/ubuntu and i miss a lot of php packages on aws linux2.
I know it's still a candidate and not a final LTS release. Only worked for a month with this distro and saw a lot of changes and updates. Some php dependencies can be solved with pear or pecl, but I couldn't get nothing working on php-imap.
php-imap depends on libc-client (maybe that's a problem?)
Here is my solution.
Search for the libc-client rpm that correspond to your version and
install manually.
Search for the rpm that corresponds to your php installed version. In my case it was 7.2.5**-2** about 2 weeks ago. (today is
7.2.5**-3** ) and isntall manually
CODE
wget https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64//php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm -P /tmp
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libc-client-2007f-16.el7.x86_64.rpm -P /tmp
rpm -i /tmp/libc-client-2007f-16.el7.x86_64.rpm
rpm -i /tmp/php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm
If it fails because Failed dependencies:
rpm -ivh /tmp/php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm --nodeps
I dont like this solution, but can't find for now any other solution more stable and easy. It will be a pain with updates....

Unable to install ionic2 on Mac OS by installing node and npm also

unable to install ionic 2
Successfully Installed ionic2#beta using
sudo npm install -g ionic#beta
ionic -v shows version 1.7.14
Uninstalled using npm uninstall -g ionic
Successfully (based on printout) uninstalled ionic 2
ionic -v shows version 1.7.14 (WTF)
Tried npm uninstall -g ionic again
Received command prompt immediately, no other outputs (no affect)
ionic -v shows version 1.7.14
You have 2 choices.
As comment suggests do:
sudo npm install -g ionic#beta
You will have to do this for every global command as you dont have permission to the folders.
Or
Check npm fix permission issue
You can change the global node module directory of npm so that you wont need permission. You can also use app like homebrew to set up your node.