问题描述
我在 .gitignore 中添加了 node_modules,这不是问题!
如何解决这个错误,因为在引擎中我已经指定了两者的版本。
这是代码:
{
"name": "server","version": "1.0.0","description": "","main": "index.js","engines": {
"node":"12.6.2","npm":"6.14.4"
},"scripts": {
"start": "node index.js"
},"author": "smeet_kothari","license": "ISC","dependencies": {
"express": "^4.17.1"
}
}
这是我的 index.js 文件
const app = express();
app.get('/',(req,res) => {
res.send({hi:'there'});
});
const PORT = process.env.PORT || 5000;
app.listen(PORT);
G:\01) Web Development\10) nodejs project\[FreeCourseSite.com] Udemy - Node with React Fullstack Web Development\MailFeed\server>heroku -v
heroku/7.47.7 win32-x64 node-v12.16.2
提前感谢您的解决方案!
解决方法
好像你还没有为项目定义 Procfile,如果仍然没有解决,请先尝试注释命令行中出现的总错误