# How can I update each dependency in package.json to the latest version?

To update each dependency in `package.json` to the latest version, you can use the `npm-check-updates` package. Here are the steps:

1. Install the `npm-check-updates` package globally by running the following command:

```bash
npm install -g npm-check-updates
```

2. Run the following command to update the `package.json` file:

```bash
ncu -u
```

This command will update all dependencies in `package.json` to their latest version. It will also update the version numbers in `package-lock.json` or `yarn.lock`, depending on which package manager you are using.

3. Run the following command to install the updated dependencies:

```bash
npm install
```

That’s it! Your dependencies should now be updated to the latest version.

**Note**: This might break some of your APIs. For example, if your `package.json` has `webpack` version 1, updating it to the latest version might break your build. Therefore, it’s important to test your application thoroughly after updating your dependencies.