Home > Software design >  Pinning typescript version during cdk init
Pinning typescript version during cdk init

Time:06-04

I am creating a new CDK app in typescript using the following command:

npx --yes [email protected] init app --language typescript --generate-only 

The package.json file thus generated has a typescript version ^3.9.7. I would like to use version 4.6.4 instead. How can I pass the parameter to force cdk init to use the desired version?

CodePudding user response:

The CDK (v1 and v2) work with Typescript v4. You can manually edit the Typescript vesion in package.json to the desired version at any time. Run npm outdated to preview, npm update to update the packages. Npm will yell at you if there are dependency conflicts.

Note: CDK v1 is in maintenance mode. Initialize a current v2 project with npx --yes cdk init ...

  • Related