7

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.

3 Answers 3

7

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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

 web npm install

Comments

0

You just need to add nodejs buildpack on heroku settings app, after that you will be able to use npm commands.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.