【发布时间】:2020-12-16 04:25:48
【问题描述】:
使用 Heroku 部署时,我的日志中出现以下错误,我该怎么办?
我的procfile:
web: node bin/www
我的package.json:
{
"name": "express-generator",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "./node_modules/.bin/nodemon.cmd ./bin/www"
},
"dependencies": {
"config": "^3.3.1",
"cookie-parser": "~1.4.4",
"cors": "^2.8.5",
"debug": "~2.6.9",
"express": "~4.16.1",
"http-errors": "~1.6.3",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.9.29",
"morgan": "~1.9.1",
"passport": "^0.4.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^6.0.1",
"pug": "^3.0.0"
},
"devDependencies": {
"nodemon": "^2.0.4"
}
}
【问题讨论】:
-
Please don't post screenshots of text。它们无法被搜索或复制,并且可用性差。相反,将代码作为文本直接粘贴到您的问题中。如果选择它并单击
{}按钮或Ctrl+K,则代码块将缩进四个空格,这将导致其呈现为代码。 -
你不应该在 Heroku 上使用
nodemon根本。那是一个开发工具,而不是应该在生产中使用的东西。但是nodemon.cmd是什么?那是Windows的东西吗? Heroku 不运行 Windows。请edit您的问题并向我们展示您的package.json,如果您有,请告诉我们您的Procfile。 -
我已经编辑了我的问题。这是一个学校项目,所以我必须用 heroku 和 nodjs 来做。
-
当我将它更改为 nodemon(没有 .cmd)而不是它只是 nodemon:未找到。
-
“只是 nodemon:未找到”——在 Windows 上还是在 Heroku 上?无论如何,我认为您的问题是另一回事。我会添加一个答案。
标签: node.js heroku logging permissions