Skip to content

Commit

Permalink
Don't require sudo for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
cartalla committed Jun 23, 2022
1 parent 57da982 commit 003740b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ fi
CDK_VERSION=2.21.1 # If you change the CDK version here, make sure to also change it in source/requirements.txt
if ! cdk --version &> /dev/null; then
echo "CDK not installed. Installing global version of cdk@$CDK_VERSION."
sudo npm install -g aws-cdk@$CDK_VERSION
if ! npm install -g aws-cdk@$CDK_VERSION; then
sudo npm install -g aws-cdk@$CDK_VERSION
fi
fi
version=$(cdk --version | awk '{print $1}')
if [[ $version != $CDK_VERSION ]]; then
echo "Updating the global version of aws-cdk from version $version to $CDK_VERSION"
sudo npm install -g aws-cdk@$CDK_VERSION
if ! npm install -g aws-cdk@$CDK_VERSION; then
npm install -g aws-cdk@$CDK_VERSION
fi
fi

# Create python virtual environment
Expand Down

0 comments on commit 003740b

Please sign in to comment.