Heroku failing to start my node app because its trying to do it with nodemon

末鹿安然 提交于 2019-12-04 06:09:36

Change your Procfile to this:

web: node app.js

Being app.js the entry point to your app.

This is assuming you don't really need nodemon in your app, since you have listed it at the package.json sample you provided.

I know that OP got the answer but I thought I might share what worked for me, in a slightly different senario:

Procfile contains the following:

web: npm start

And for my package.json file I defined:

"scripts":{
    "start": "node ./bin/www"
}

And that fixed this issue for me.

Recently I'm working on deployed my node js appication in heroku by using nodemon, for it's working fine. we have to follow few step to reslove nodemon is not found.

1)Package.json

 npm start: nodemon server.js

2)We need to modified procfile like below.

 web: nodemon server.js

3)Use below command line to login for heroku

 $ heroku login

4)Create new application

   $heroku create <appication-name>

I think most of the developer directly deployed to heroku through github Id. Locally node_modules are work fine ,after deployed your application in heroku (inside we are n't able to access the node_modules), so for that we have access the respository.

5)Clone the repository from heroku

$ heroku git:clone -a <application-name>
$ cd cv-application

Now we are able access the application.

6)Delete you node_modules and try to install package by using below command.

$ npm install.

Deploy your changes.

$ git add .
$ git commit -am "make it better"
$ git push heroku master.

npm version sholud be 6.4.1.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!