Skip to content

Instantly share code, notes, and snippets.

@1Mouse
Created July 9, 2024 14:53
Show Gist options
  • Save 1Mouse/d58e57737e4b9300d98fc56c4411f45a to your computer and use it in GitHub Desktop.
Save 1Mouse/d58e57737e4b9300d98fc56c4411f45a to your computer and use it in GitHub Desktop.
update dependencies with yarn

To update a TypeScript development dependency to the latest version using Yarn, you can follow these steps:

  1. Check the current version: Before updating, it's often useful to check the current version of the TypeScript dependency.
  2. Update the dependency: Use Yarn to update the dependency to the latest version.
  3. Verify the update: Ensure the dependency has been updated correctly.

Here is a step-by-step guide:

Step 1: Check the current version

You can check the current version of TypeScript in your package.json file or by running:

yarn list typescript

Step 2: Update the dependency

To update TypeScript to the latest version, use the following command:

yarn add typescript@latest --dev

This will update TypeScript to the latest version and save it as a development dependency.

Step 3: Verify the update

After updating, you can verify the update by checking the package.json file or by running:

yarn list typescript

You should see the latest version of TypeScript listed.

Alternative: Using interactive upgrade

Yarn also provides an interactive tool to upgrade dependencies. You can use this to upgrade TypeScript interactively:

yarn upgrade-interactive --latest

This command will list all outdated dependencies, allowing you to select TypeScript and update it to the latest version.

By following these steps, you can ensure that your TypeScript development dependency is up to date with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment