我是个新手,用js.Trying来运行一个简单的应用程序,得到这个错误,却找不出出了什么问题
D:\React app\react-app1>npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Muralidharan\AppData\Local\npm-cache\_logs\2022-05-29T08_51_37_315Z-debug-0.log
这是package.json文件
{
"name": "react-app1",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-scripts": "5.0.1"
}
}
安装有什么问题吗?或者类似的过时版本?
发布于 2022-05-29 09:09:22
这是因为在您的package.json文件中没有名为"start“的脚本。下面是一个具有这样的脚本的package.json文件的示例:
{
"name": "your-project",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "node main.js"
},
"author": "Muralidharan",
"dependencies": {
}
}
https://stackoverflow.com/questions/72422313
复制相似问题