How to Update Nextjs to Latest Verstion | Specfic Next Version
Updated at: 24 April 2025Deepak Painkra
To install the specific version of the next. Now, open your package.json file to remove the next, react and react-dom versions, delete the node_module folder and run npm install, and you can now able to install specific versions of next, react and react-dom. In the same way, you can update to the latest version of next
 Why update is vital?
It is crucial for performance and security because it receives the latest bug fixes and vulnerability assessment improvements. I always recommend you update your app and packages to the newer version.
 Installing Specific Version of the Next, React and React-Dom
Here’s the command you can run to install the latest or a specific version of Next, React, and ReactDOM.
Also, follow the next tutorial to update your specific package in the next project.
 But first, you must have a backup of your Nextjs project, in case the latest version is not compatible with some library. So you have the option to install the particular version. 
Updating Nextjs app
Now let me walk you through how you can update the NextJS app and packages,
For this tutorial, we are using the Yarn and NPM package manager. Now, open the terminal in VSCODE and issue this command,
Updating all the Packages
Now, let us go ahead and update the latest version of the packages. You could check the packages are running on the latest version by issuing this command,
After checking the version, now to update the package, you can issue this command,
This command will update all the packages.
For Yarn
To update packages while using yarn, you can issue this command in the terminal,
Updating Packages to the Latest Version,
To update the Nextjs packages, first, issue this command to check the latest version of the packages,
After that, issuing this command to update the packages,
This command will update all the packages to the latest version.
 For Yarn
You can also delete the Node Module folder and then issue this command to regenerate the Node Module folder, which is a package manager.
To update the next version. Delete the package.lock.json file, and node_module folder from your project and remove the next version of the package.json.
Incompatible Issue
If you get an incompatible issue, you are required to downgrade the react and the next version. To downgrade the next or react version, you have to remove the react and next version from the package.json file and also delete the packages.lock file and delete node_module file.
After that issue of this command,
Then after, install the react and the next version,
Now, you can start the development environment by issuing the above command and checking the terminal if you are facing an error.
Now, If you are still getting the same error, the only option is to create a new app.
Support Us
Your support helps us continue our work. Please consider making a donation.
Donate with PayPal