How to Update a NodeJs Project with dependency-time-machine
To update a project using dependency-time-machine, you can follow a straightforward process that automates the task of updating dependencies in your package.json file in chronological order.
Step 1:Install the Tool
You can use the following command to install dependency-time-machine globally or run it via npx:
Alternatively, install it globally using npm:
Step 2: Update Dependencies
Once installed, you can run the tool to start updating your dependencies:
This command will check for the latest compatible versions of your dependencies and update them one by one, ensuring each version is compatible before proceeding to the next.
Step 3: Auto-run Tests
To automate testing after each update (using npm test
by default), you can add the --auto
flag:
You can also customize the install and test commands:
Step 4: Excluding Dependencies
If there are specific dependencies you want to exclude from the update process, use the --exclude
flag:
Read also how to update all dependencies using npm-check-updates.
For more advanced options, such as excluding dependencies via a file or generating a timeline of updates, refer to the detailed documentation on npm.