Skip to content

Commit c00b974

Browse files
authored
docs: Update template README.md (JavaScript, TypeScript) (#28003)
Use npx to run project-specific cdk, not a globally installed version. This ensures everybody working on the project uses the same version of the command-line interface. With the previous instructions, if anybody had `cdk` installed globally, e.g., via `npm install --global aws-cdk` or `homebrew install aws-cdk`, they would run that version. It seems desirable that everybody working on a CDK app uses the same version of the command-line interface, as specified in `package.json` (or `package-lock.json`). Example: Given a `package.json` which specifies `"aws-cdk": "2.104.0"` and a globally installed `cdk`, this can happen: ```shell $ cdk --version 2.108.1 (build 2320255) $ npx cdk --version 2.104.0 (build 3b99abe) ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent bf9bb3d commit c00b974

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/aws-cdk/lib/init-templates/app/javascript/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app. The build ste
77
## Useful commands
88

99
* `npm run test` perform the jest unit tests
10-
* `cdk deploy` deploy this stack to your default AWS account/region
11-
* `cdk diff` compare deployed stack with current state
12-
* `cdk synth` emits the synthesized CloudFormation template
10+
* `npx cdk deploy` deploy this stack to your default AWS account/region
11+
* `npx cdk diff` compare deployed stack with current state
12+
* `npx cdk synth` emits the synthesized CloudFormation template

packages/aws-cdk/lib/init-templates/app/typescript/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app.
99
* `npm run build` compile typescript to js
1010
* `npm run watch` watch for changes and compile
1111
* `npm run test` perform the jest unit tests
12-
* `cdk deploy` deploy this stack to your default AWS account/region
13-
* `cdk diff` compare deployed stack with current state
14-
* `cdk synth` emits the synthesized CloudFormation template
12+
* `npx cdk deploy` deploy this stack to your default AWS account/region
13+
* `npx cdk diff` compare deployed stack with current state
14+
* `npx cdk synth` emits the synthesized CloudFormation template

0 commit comments

Comments
 (0)