【发布时间】:2021-11-28 06:34:59
【问题描述】:
这是我的 package.json 文件:
"name": "food-recipe",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "react-scripts build",
"start": "next start"
},
"dependencies": {
"@contentful/rich-text-react-renderer": "^15.4.0",
"contentful": "^9.0.3",
"next": "11.1.2",
"react": "17.0.2",
"react-dom": "17.0.2"
}
}
【问题讨论】:
-
尝试使用
npm i --save react-scripts安装它 -
我做到了,但出现了另一个错误:找不到所需的文件。名称:index.html
-
react-scripts用于 CRA 应用程序。在 Next.js 应用程序中,您应该改用next build。 -
我从头开始重建了应用程序,但出现了不同的错误。你能看看我在这里发布的问题。 stackoverflow.com/questions/69505993/…
标签: reactjs npm next.js package.json