Next.js error. Part 1

Error “‘next’ is not recognized as an internal or external command, operable program or batch file”

The error “‘next’ is not recognized as an internal or external command, operable program or batch file” occurs when we forget to install the dependencies in a Next.js project.

To solve the error, run npm install react react-dom next to install next before running npm run dev.

Open your shell in your project’s root directory (where your package.json is) and run the following commands.

If you use NPM:

npm install

npm install react react-dom next

npm run dev

If you use YARN:

yarn install

yarn add react react-dom next

yarn dev

Posted by Edgar Hovhannisyan

Comments

Your email address will not be published. Required fields are marked *