我正在尝试使用生成器来设置一个express.js服务器。我已经按照文档的说明成功地创建了基本结构。但是如果我尝试运行给定的命令(SET DEBUG=transcriptverificationserver:* & npm start
)来启动服务器,我总是得到以下错误:
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
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\a\AppData\Local\npm-cache\_logs\2022-11-28T22_43_43_285Z-debug-0.log
PS C:\Users\a\Desktop\Verified Transcripts\Webpage> 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\a\AppData\Local\npm-cache\_logs\2022-11-28T22_45_41_209Z-debug-0.log
我认为这是package.json文件中的问题。脚本部分如下所示:
"scripts": {
"start": "node ./bin/www"
},
我没有改变任何文件或结构,我只是简单地从文档(https://expressjs.com/en/starter/generator.html)复制命令感谢任何帮助提前
1条答案
按热度按时间cyvaqqii1#
我又试了一次,这一次一切都正常。我不确定以前发生过什么,但我可能使用了旧的安装方法。
我第二次尝试确保使用新的方法: