Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying App on heroku node command not found

Tags:

node.js

heroku

I have basically modified this app

https://github.com/heroku/node-js-getting-started.git

Now am trying to deploy in Heroku

My Procfile has this line

web:node index.js

And when I run this command locally,there are no probs..

However if I try to open the link in my browser after following all the steps in https://blog.risingstack.com/node-hero-deploy-node-js-heroku-docker/

I get an error On checking the logs using heroku logs command I am getting 'node command not found' Anyone knows the prob?

P.S : I tried changing Procfile contents to npm start but that doesnt launch index.js in the browser.

like image 590
Solo Avatar asked Aug 30 '16 21:08

Solo


2 Answers

I suspect that you have not set the buildpacks. Buildpacks tells heroku which kind of application is yours.

Use the below command to set the application of type nodejs.

heroku buildpacks:set heroku/nodejs

And make sure that you have a package.json file in the root of the project which is read by heroku to install the project dependencies.

like image 110
Abhilash Chelankara Avatar answered Sep 22 '22 11:09

Abhilash Chelankara


Why don't you try this below in your Procfile.In my case it runs nicely.

 web npm install
like image 26
nilakantha singh deo Avatar answered Sep 23 '22 11:09

nilakantha singh deo