Next.js is among the top frameworks for ReactJS. It is used in server-side rendering and static web apps. Just like any other framework you might come across before.It is helpful if you know the version you are working on. This will be very helpful, especially when facing issues in features, bug fixing, or compatibility. So in this tutorial, we will go through the different methods to check the version of Next.js in your project. Frequently Asked Questions related to versions of Next.js we have covered so far.
Method 1: Checking the Next.js Version Using package.json
Every dependency you installed earlier on, with its version, it is present inside your project directory in the package.json
file.
You can also read is Nextjs hard to learn ?
Here is how you can check the version:
- Open
package.json
:
Go to the root directory of your project and open thepackage.json
file in any text editor. - Find the Next.js Dependency:
Inside thepackage.json
file, find thedependencies
ordevDependencies
section.
You will see something like `”next”: “^12.1.0″‘; the number may vary depending on when you installed it. - Checking Next.js Version: The number at the side of
"next":
indicates the version your project.
Method 2: Checking the Version of Next.js Using Command Line

You can also check the version of your nextjs apart from the first method directly at the command line. For my readers that love command line this is for you.
- Open Terminal or Command Prompt:
- Go to your project directory using
cd path/to/your/project
.
- Run the Version Command:
- You are required to run the following command:
npx next --version
- If you don’t like the first one , you can use this one:
npm list next
This command will return the version of Next.js installed in your project.
Method 3: How to Check Next.js Version Using Node Modules
You can also find the version of Next.js using the installed node modules.
- Get into
node_modules
:
- Move into the
node_modules
directory inside your project’s root folder.
- Find the
next
Folder:
- Inside the
node_modules
folder, find thenext
directory.
- Open the Nextjs
package.json
:
- Open the
next
directory. - Open
package.json
. - Scroll to the
"version"
field.
Method 4: Checking the Next.js Version Using the Browser Console
If your Next.js application is running in development mode, check the version via the browser console.
- Open Your Application in a Browser:
Run a Next.js app by usingnpm run dev
oryarn dev
, open it in a web browser. - Open the Browser Console:
- Right-click on the page and choose “Inspect” or use the shortcut key combination
Ctrl+Shift+I
(Windows) orCmd+Option+I
(Mac) to open DevTools. - Move to the “Console” tab.
- Check the Version:
Inside the console, add__NEXT_DATA__.buildId
and press Enter.
- It will return a string, this string will provides information of your nextjs version along with the build ID of your Next.js application.
Method 5. How to get the current Next.js version by using npx create-next-app
If you are to create a new Next.js project, then followed thus method though I don’t recommend it. Then at the project creation step you can see the version explicitly as shown below:
- Run
npx create-next-app
:
- Run
npx create-next-app@latest
to create a new project using the latest version. - You can also use a specific version by running something like
npx create-next-app@12.1.0
. though it depends what you want it what someone recommend you to do
- Version Verification:
- Since this example is for the setup, the terminal will indicate which version of Next.js you have installed. But you need other method to know the version next time
5 Frequently Asked Questions (FAQs) About Next.js Versions
Answer: You can Update Next.js either from npm or yarn. In order to change to the newest version of nextjs, execute either npm install next@latest or yarn add next@latest in your project directory.
Yes, you can downgrade to another version by specifying it in your package.json file, or you can use npm install next@<version>
This example will explain it clearly. Use npm install next@10.2.0, or yarn add next@<version>. Please Make sure that your project is compatible with the older version before you downgrade.
Answer: For checking compatibility, you need to refer to the Next.js doc and their release notes in case there are any compatibility notes or breaking changes. You can also use tools like npm outdated to see if your other dependencies need to be updated with Next.js.
Yes . It will help you to patch security issues and have access to new features.
Conclusion
This comprehensive tutorial will help you know to check your versions of Nextjs anytime . Make sure that you have followed the tutorial , step by step . Congratulations as you continue to code .