简体   繁体   English

当我在终端输入“heroku logs --tail”时如何修复以下错误? 这是什么意思?

[英]How to fix the following errors when I typed in “heroku logs --tail” on my terminal ?? what does it mean?

I just started learning how to code a month ago by watching many videos and tutorials. 我刚开始学习如何通过观看许多视频和教程来编写代码。 This is the first time I'm using stackoverflow to ask questions. 这是我第一次使用stackoverflow提问。 I appreciate your time in reading this! 感谢您抽出宝贵的时间阅读本文! I'm in the process of deploying my app to Heroku but I'm not sure why it keeps showing up the following errors when I typed in "heroku open" in my terminal, it said I have "application error". 我正在将我的应用程序部署到Heroku但我不确定为什么当我在终端输入“heroku open”时它会一直显示以下错误,它说我有“应用程序错误”。 I've already installed nodemon but it showed that "nodemon not found". 我已经安装了nodemon,但它显示“找不到nodemon”。 I appreciate any help! 我感谢任何帮助! (mac version: macOS Mojave) (mac版:macOS Mojave)

sh: 1: nodemon: not found
npm ERR! file sh
: npm ERR! code ELIFECYCLE
: npm ERR! errno ENOENT
: npm ERR! syscall spawn
: npm ERR! finalproject-api@0.1.0 start: `nodemon server.js`
: npm ERR! spawn ENOENT
: npm ERR!
: npm ERR! Failed at the finalproject-api@0.1.0 start script.
: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Can you change your Procfile to start your application with node instead of nodemon ? 您是否可以更改Procfile以使用node而不是nodemon启动应用程序? Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Nodemon是一个实用程序,它将监视源中的任何更改并自动重新启动服务器。 Perfect for development, but not ideal to use on Heroku since Heroku supports the node buildpack and not nodemon . 完美的开发,但不适合在Heroku上使用,因为Heroku支持node buildpack而不是nodemon

Something like the following: 类似于以下内容:

Procfile: Procfile:

web: node server.js

Hopefully that fixes your issue! 希望这可以解决您的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM