[英]git push heroku master Remote failed
This is my error image getting on heroku logs --tail这是我在 heroku 日志中获取的错误图像 --tail
above is a given image of my errors.以上是我的错误的给定图像。 When I am trying to deploy my nodejs app Getting error on git push Heroku master.
当我尝试部署我的 nodejs 应用程序时,在 git 推送 Heroku master 时出现错误。 .
. .
. .
. Remote failed working properly on local server.
远程无法在本地服务器上正常工作。 I am beginner please help my git id is cosmos-dx and there is a git repo of name Webdictionary
我是初学者,请帮助我的 git id 是 cosmos-dx 并且有一个名为 Webdictionary 的 git repo
After reading through the nodemon docs , and taking the fact that you stated you are new, I think I know what is happening.在阅读了nodemon docs并接受了你说你是新手的事实之后,我想我知道发生了什么。
In the nodemon docs it gives you two ways to install, one is globally npm install -g nodemon
and the other is to install it in the dev dependencies npm install --save-dev nodemon
.在 nodemon 文档中,它为您提供了两种安装方式,一种是全局
npm install -g nodemon
,另一种是将其安装在开发依赖项中npm install --save-dev nodemon
。 Either of these options would make nodemon not be present if the build to heroku uses npm install --only=production
.如果构建到 heroku 使用
npm install --only=production
,那么这些选项中的任何一个都会使 nodemon 不存在。 I assume they do that.我假设他们会那样做。
In your package.json file, change the npm start
script to this:在您的 package.json 文件中,将
npm start
脚本更改为:
"start": "node ser1.js"
As nodemon is not present in the heroku built application, your current start script will fail.由于 heroku 构建的应用程序中不存在 nodemon,因此您当前的启动脚本将失败。 If you want to continue using nodemon for local development you can add a new script:
如果你想继续使用 nodemon 进行本地开发,你可以添加一个新脚本:
"dev": "nodemon ser1.js"
From there to run your application, with nodemon, on your local machine you would run npm run dev
从那里运行你的应用程序,使用 nodemon,在你的本地机器上你将运行
npm run dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.