【发布时间】:2022-08-05 23:54:52
【问题描述】:
日志:
.\\yoshi-realese> git push heroku master
Enumerating objects: 2449, done.
Counting objects: 100% (2449/2449), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2353/2353), done.
Writing objects: 100% (2449/2449), 4.63 MiB | 2.71 MiB/s, done.
Total 2449 (delta 275), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote: -----> Build
remote: Running build
remote: > yoshi-v1@1.0.0 build
remote: > nodemon app.js
remote: [nodemon] 2.0.19
remote: [nodemon] to restart at any time, enter `rs`
remote: [nodemon] watching path(s): *.*
remote: [nodemon] watching extensions: js,mjs,json
remote: [nodemon] starting `node app.js`
remote: started yoshistore
之后什么也没有发生。
这是我的package.json:
{
\"name\": \"yoshi-v1\",
\"version\": \"1.0.0\",
\"description\": \"\",
\"main\": \"app.js\",
\"scripts\": {
\"build\": \"nodemon app.js\",
\"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"
},
\"author\": \"\",
\"license\": \"ISC\",
\"dependencies\": {
\"@handlebars/allow-prototype-access\": \"^1.0.5\",
\"express\": \"^4.18.1\",
\"express-handlebars\": \"^6.0.6\",
\"handlebars\": \"^4.7.7\",
\"mongoose\": \"^6.5.1\",
\"nodemon\": \"^2.0.19\"
}
}
-
你期望会发生什么?
-
在构建之后,应该会进行压缩和启动。一切完成后,控制台中将出现一个指向该站点的链接
-
稍后在 heroku 日志中有一行 -----> Timed out running buildpack Node.js
-
请告诉我们您的
package.json。我怀疑您的构建脚本正在尝试实际运行您的应用程序。 -
{ \"name\": \"yoshi-v1\", \"version\": \"1.0.0\", \"description\": \"\", \"main\": \"app. js\", \"scripts\": { \"build\": \"nodemon app.js\", \"test\": \"echo \\\"错误:没有指定测试\\\" && 退出1\" }, \"author\": \"\", \"license\": \"ISC\", \"dependencies\": { \"@handlebars/allow-prototype-access\": \" ^1.0.5\", \"express\": \"^4.18.1\", \"express-handlebars\": \"^6.0.6\", \"handlebars\": \"^4.7. 7\", \"猫鼬\": \"^6.5.1\", \"nodemon\": \"^2.0.19\" } }