Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 无法启动next.js_Reactjs_Next.js - Fatal编程技术网

Reactjs 无法启动next.js

Reactjs 无法启动next.js,reactjs,next.js,Reactjs,Next.js,要设置next.js环境,我们按以下顺序运行命令。 运行它之后,我运行了Thread dev,但出现了一个错误 错误 执行命令 ・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", &

要设置next.js环境,我们按以下顺序运行命令。
运行它之后,我运行了Thread dev,但出现了一个错误

错误

执行命令

・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"
  }
}
“脚本”
中,将
“开发人员”
“开发人员”:“下一个开发人员”
修改为
“开发人员”:“下一个”

“脚本”
应该如下所示:

  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }