From c00b9746e3b8663fffc7658932eb11c132c266a0 Mon Sep 17 00:00:00 2001 From: Paul Meinhardt Date: Thu, 16 Nov 2023 16:46:45 +0100 Subject: [PATCH] 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* --- .../aws-cdk/lib/init-templates/app/javascript/README.md | 6 +++--- .../aws-cdk/lib/init-templates/app/typescript/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/app/javascript/README.md b/packages/aws-cdk/lib/init-templates/app/javascript/README.md index e275326a4243e..8b69061e1c153 100644 --- a/packages/aws-cdk/lib/init-templates/app/javascript/README.md +++ b/packages/aws-cdk/lib/init-templates/app/javascript/README.md @@ -7,6 +7,6 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app. The build ste ## Useful commands * `npm run test` perform the jest unit tests -* `cdk deploy` deploy this stack to your default AWS account/region -* `cdk diff` compare deployed stack with current state -* `cdk synth` emits the synthesized CloudFormation template +* `npx cdk deploy` deploy this stack to your default AWS account/region +* `npx cdk diff` compare deployed stack with current state +* `npx cdk synth` emits the synthesized CloudFormation template diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/README.md b/packages/aws-cdk/lib/init-templates/app/typescript/README.md index 320efc02a9275..9315fe5b9fc53 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/README.md +++ b/packages/aws-cdk/lib/init-templates/app/typescript/README.md @@ -9,6 +9,6 @@ The `cdk.json` file tells the CDK Toolkit how to execute your app. * `npm run build` compile typescript to js * `npm run watch` watch for changes and compile * `npm run test` perform the jest unit tests -* `cdk deploy` deploy this stack to your default AWS account/region -* `cdk diff` compare deployed stack with current state -* `cdk synth` emits the synthesized CloudFormation template +* `npx cdk deploy` deploy this stack to your default AWS account/region +* `npx cdk diff` compare deployed stack with current state +* `npx cdk synth` emits the synthesized CloudFormation template