reactjs 下一个开发不保持运行,自动停止

2hh7jdfx  于 2023-01-30  发布在  React
关注(0)|答案(1)|浏览(131)

我试图运行一个Next v13.1.6项目,我刚刚使用yarn create next-app创建了它,但由于某种原因,当我运行yarn dev时,它会自动停止,就像它是一个构建一样
在这里你可以看到:

我的package.json看起来像这样:

{
  "name": "nft-generator",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@next/font": "13.1.6",
    "@types/node": "18.11.18",
    "@types/react": "18.0.27",
    "@types/react-dom": "18.0.10",
    "eslint": "8.33.0",
    "eslint-config-next": "13.1.6",
    "next": "13.1.6",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "typescript": "4.9.4"
  }
}
zdwk9cvp

zdwk9cvp1#

您需要使用next dev来保持它在更改时自动重新启动。将"dev":"next"更改为"dev":"next dev"

相关问题