0

To set up the next.js environment, we ran the commands in the following order.
After running it, I ran yarn dev but got an error.

error

warning package.json: No license field
error Command "dev" not found.

Command executed

・yarn create next-app
・yarn add next react react-dom
・touch tsconfig.json
・yarn add --dev typescript @types/react @types/node

package.json

{
  "name": "nextapp",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "10.0.4",
    "react": "17.0.1",
    "react-dom": "17.0.1"
  }
}

1 Answer 1

1

In your "scripts" modify the "dev" from "dev": "next dev" to "dev": "next".

"scripts" should look like:

  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.