Reputation: 193
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.
Upvotes: 7
Views: 8091
Reputation: 1477
You just need to add nodejs buildpack on heroku settings app, after that you will be able to use npm commands.
Upvotes: 0
Reputation: 1006
Why don't you try this below in your Procfile.In my case it runs nicely.
web npm install
Upvotes: 2
Reputation: 406
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.
Upvotes: 7