Skip to content

Commit

Permalink
docs: Update template README.md (JavaScript, TypeScript) (#28003)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
pmeinhardt authored Nov 16, 2023
1 parent bf9bb3d commit c00b974
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/aws-cdk/lib/init-templates/app/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions packages/aws-cdk/lib/init-templates/app/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c00b974

Please sign in to comment.