How to Upgrade NestJS 9 to 10: A Developer's Guide
amir fakoor
Posted on June 25, 2023
In this tutorial, we will walk through the process of upgrading a NestJS application from version 9 to 10. This guide is intended for developers who have an existing NestJS project and wish to update it to the latest version.
Step 1: Update the NestJS CLI
First, update the NestJS CLI to the latest version by running the following command:
npm install -g @nestjs/cli
Verify the installed version with:
nest --version
Step 2: Install npm-check-updates
To update your dependencies, install the npm-check-updates package globally:
npm i -g npm-check-updates
Step 3: Update package.json
Use ncu -u to update your package.json file with the latest dependencies:
ncu -u -f /^@nestjs/
Step 4: Verify Changes
Review the changes in your package.json file, ensuring that the NestJS dependencies are updated to the desired version (v10).
Step 5: Remove package-lock.json and node_modules
Delete the package-lock.json file and the node_modules folder with the following commands:
rm package-lock.json
rm -rf node_modules
Step 6: Install Updated Dependencies
Finally, install the updated dependencies:
npm install
Conclusion
After completing these steps, your NestJS application should be updated to version 10. Be sure to test your application thoroughly to ensure that there are no issues or breaking changes caused by the upgrade. Happy coding!
Posted on June 25, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.