'cdk' is not recognized as an internal or external command - amazon-web-services

I am trying my hands with AWS CDK & as the first step, I need to install cdk & as per below link
https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html
I tried installing the same
Steps.
node --version => v15.14.0
npm --version => 7.11.2
aws -version => aws-cli/2.2.1 Python/3.8.8 Windows/10 exe/AMD64 prompt/off`
npm -g install typescript
aws configure (AWS AccessKey, Secret,Region)
npm -g install aws-cdk
Now closed all the cmd instances & ran
cdk --version
this throws the below error
'cdk' is not recognized as an internal or external command
Then I added the below path of cdk to environment variable
C:\Users\kgn-dev\AppData\Roaming\npm\node_modules\aws-cdk\bin\cdk
still the same issue.
How do I get cdk command running?
I am using Windows 10

try to add the following path to the environment variable
C:\Users\kgn-dev\AppData\Roaming\npm\node_modules\aws-cdk\bin

Related

Error with dependencies on AWS JupyterLab notebook (runing alphafold on AWS)

I'm trying to run the alphafold.v2 on AWS via their batch architecture program (github link: https://github.com/aws-samples/aws-batch-architecture-for-alphafold)
When running the first command to install dependencies:
%pip install -r notebook-requirements.txt -q -q
I'm getting the following error message:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.
This behaviour is the source of the following dependency conflicts.
awscli 1.24.10 requires botocore==1.26.10, but you have botocore 1.23.54 which is incompatible.
aiobotocore 1.3.0 requires botocore<1.20.50,>=1.20.49, but you have botocore 1.23.54 which is incompatible
I'm a bit confused as to how I can meet both requirments for a botocore 1.26.10 and botocore<1.20.50,>=1.20.49 - is it possible to have both installed at the same time?
Thank for the help!

What is the difference between npm package cdk and aws-cdk?

In shell scripts interacting with the AWS CDK Toolkit, I often see both npx -- cdk and npx -- aws-cdk. Apparently, there are two npm packages cdk and aws-cdk. What is the difference between these two?
Moreover, I make confusing observations when interacting with these two packages.
npx -- cdk --version # output: Need to install the following packages: cdk#2.32.1
npx -- aws-cdk --version # output: Need to install the following packages: aws-cdk#2.32.1
Since neither package is installed locally, both commands want to install the corresponding package, fine.
npm install -g cdk#2.32.0
npx -- cdk --version # output: 2.32.0 (build 00e0c2d)
npx -- aws-cdk --version # output: Need to install the following packages: aws-cdk#2.32.1
After installing cdk locally, npx -- cdk executes the local package and npx -- aws-cdk still wants to install aws-cdk, also fine.
npm install -g aws-cdk#2.32.0
npx -- cdk --version # output: 2.32.0 (build 00e0c2d)
npx -- aws-cdk --version # output: Need to install the following packages: aws-cdk#2.32.1
Now it gets confusing. Although we locally installed aws-cdk rather than cdk, npx -- cdk still executes some local package and npx -- aws-cdk still wants to install aws-cdk. Why?
The aws-cdk package provides a cdk command, the entry point to the AWS Cloud Development Kit.
When you install aws-cdk package in node_modules/.bin there is a cdk command installed.
This allows one to use cdk command inside package.json scripts.
The cdk command is also the only command added to .bin by aws-cdk.
As per all of the documentation, in order to interact with AWS CDK from CLI, one should use cdk command. That is even though the package name is aws-cdk.
Now, the npx provides a convenient way to run a command from a package regardless if it is already installed.
This works in the most straightforward way when the package name matches the command name it provides. This is not the case for aws-cdk.
In order to fix that, and allow anyone to run npx cdk ... the AWS CDK decided to publish a package named cdk. This is a small wrapper around cdk command provided by aws-cdk package.

Command error "amplify configure" : installation error aws amplify

I tried to install aws amplify. But when I typed those commands in cmd window
then an error message came out.
>amplify configure
"amplify" is not an internal or external command .....
In this case, what should I do?
--I'm using Windows10
You need to install the amplify-cli first.
npm install -g #aws-amplify/cli
If you have already done so, opening a new commandline and typing
amplify configure
Should begin the configuration process.
You need to install Amplify CLI and configure it first.
Install Node.js in your system
Install amplify cli using the command
npm install -g #aws-amplify/cli

Unable to install AWS SAM Cli on Mac

I am trying to install AWS SAM Cli on my Mac because I am trying to learn the AWS services. But I have installed the AWS cli successful using bundle. But when I tried to install the AWS SAM Cli as well. But it is not working. This is what I have done so far.
Run this command
pip install --user aws-sam-cli
Everything went fine.
Then I opened and edited the ~/.bash_profile. This is the content of the .bash_profile
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH
# Find your Python User Base path (where Python --user will install packages/scripts)
$ USER_BASE_PATH=$(python -m site --user-base)
# Update your preferred shell configuration
-- Standard bash --> ~/.bash_profile
-- ZSH --> ~/.zshrc
export PATH=$PATH:$USER_BASE_PATH/bin
Then I closed the terminal and run sam --version.
It is saying command not found. What is wrong with my installation?
The now recommended way to install SAM CLI is to use brew and honestly it's way better, saves you a lot of headaches, like the one you're facing now. See these instructions for details.

AWS CLI tools on Circle CI: configure: unknown command

I'm trying to deploy a docker application onto Elastic Beanstalk from Circle CI.
The deployment section of my circle.yml is
deployment:
hub:
branch: [internal, production]
commands:
- pip install awscli
- docker push company/web:$CIRCLE_SHA1
- sudo bash deploy.sh $CIRCLE_SHA1 $CIRCLE_BRANCH $CIRCLE_BUILD_NUM
and my deploy.sh calls aws cli as follows
aws --version
aws configure set aws_access_key_id $AWSKEY
aws configure set aws_secret_access_key $AWSSECRETKEY
aws configure set default.region us-west-2
aws configure set default.output json
echo "SAVING NEW DOCKERRUNFILE: $DOCKERRUN_FILE"
aws s3 cp $DOCKERRUN_FILE s3://$EB_BUCKET/$DOCKERRUN_FILE
But I get the error
--version: mispelled meta parameter?
sanity-check: "/root/.awssecret": file is missing. (Format: AccessKeyID\nSecretAccessKey\n)
configure: unknown command Usage: aws ACTION [--help]
The script works completely fine locally on mac os using the exact same key and secret.
Both versions (on circle and my mac) of awscli are 1.7.14
I'm Kevin from CircleCI. It looks like the issue here is related to the fact that when you install Python dependencies CircleCI installs them into a virtualenv. This is usually a great thing, as it isolates your python environment from the default system Python and supports our dependency cacheing. The problem here is that you're running your deploy.sh script with sudo, which clobbers the virtualenv environment and runs the default system version (which in this case is actually an older alternative AWS CLI). Dropping the sudo should fix things for you. (You would also be better off running pip install awscli==x.x.x in the "dependencies" phase, as it would be cached then.)
PS: Please contact sayhi#circleci.com for a timely response to questions in general.