question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-cdk): Installing CLI locally should be the default

See original GitHub issue

Reference docs

$ npm i -g aws-cdk

https://github.com/aws/aws-cdk/blob/master/README.md#at-a-glance

npm install -g aws-cdk

https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install

Issue

I switched CDK projects and found issues with the package.json being:

"aws-cdk": "1.68.0",

But my global version:

cdk --version // 1.79.0 (build 8b3bf9c)

Quoting from the webpack installation guide regarding global installation:

Note that this is not a recommended practice. Installing globally locks you down to a specific version of webpack and could fail in projects that use a different version.

https://webpack.js.org/guides/installation/#global-installation

Recommendation

Make installing locally the default option:

npm install aws-cdk

And install globally as an alternative option (not recommended)

npm install aws-cdk -g

This is a 📕 documentation issue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
redbaroncommented, Dec 22, 2020

aws-cdk is a CLI tool and is not directly related to @aws-cdk packages you use in your CDK app. IMHO it is fine installing it globally.

0reactions
github-actions[bot]commented, Feb 17, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS CDK Toolkit (cdk command) - AWS Documentation
These values are written to the [default] section of the config and credentials files. If you don't have the AWS CLI installed, you...
Read more >
How to install AWS CDK (step-by-step guide)
To install AWS CDK, run the following command in your terminal: npm install -g aws-cdk . This will install the AWS CDK package...
Read more >
serverless-stack/cli - SST docs
Installation​. While it can be installed globally, it's recommended to install it locally in your project instead. # With npm
Read more >
AWS Command Line Interface - LocalStack Docs
Installation. You can install the awslocal command via pip : $ pip install awscli-local[ver1]. Note that the command above also installs the latest...
Read more >
circleci/aws-cli@3.1.4
/usr/local/aws-cli. type: string. override-installed. By default, if the AWS CLI is detected on the system, the install will be skipped.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found