Search code examples
node.jsherokuforeman

Error running foreman to fire up a Node.js app


I am trying to run foreman on a Mint VM i just setup. It is for the purpose of learning node. I am using Heroku and their guide to get myself setup but i have hit a road block when i try and start foreman.

The error message is:

14:51:09 web.1  | started with pid 10739
14:51:09 web.1  | exited with code 1
14:51:09 system | sending SIGTERM to all processes
SIGTERM received

Solution

  • If you are following a guide specifically for use on a Heroku instance then it will skip some steps that will be required for setting up on other boxes. By default heroku instances have node.js installed, so there is no need to get this set up on the box prior to deploying and launching your first application.

    To install Node.js on Linux Mint. Do the following:

    1. Install required tools

      sudo apt-get install g++ curl libssl-dev apache2-utils

      sudo apt-get install git-core

    2. Clone and make latest version of Node.js

      git clone git://github.com/ry/node.git

      cd node

      ./configure

      make

      sudo make install

    3. Go to your working directory for this project and run the following:

      npm install

      foreman start

    Your Node.js application example should now be working on your local VM.

    To get a sample node app for testing your local setup do the following:

    `git clone [email protected]:heroku/node-js-sample.git # or clone your own fork`
    
    `cd node-js-sample`
    
    `npm install`
    
    `foreman start`
    

    Browse to http://localhost:5000 to see the sample application.