我在尝试使用 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: C:\Users\Ezioria\AppData\Local\npm-cache\_logs\2023-12-26T12_43_00_567Z-debug-0.log
我真的被困在这里了,帮帮我吧。我也安装了package.json
您的 package.json 缺少您尝试运行的启动脚本。 假设您的 Node 应用程序的入口文件是 index.js,package.json 中的脚本部分应如下所示:
{
"name": "app-name",
"version": "2.0",
"description": "application description",
"main": "index.js",
"scripts": {
"start": "node index.js"
}
}