1

Using the dead simple tutorial on Heroku's website and when I run git push heroku master I receive the following error:

       Using Node.js version: 0.4.7
       Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm ERR! Couldn't read dependencies.
       npm ERR! Failed to parse json
       npm ERR! Unexpected token }
       npm ERR! File: /tmp/build_17bicinzz6vv0/package.json
       npm ERR! JSON.parse Failed to parse package.json data.
       npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
       npm ERR! JSON.parse 
       npm ERR! JSON.parse This is not a bug in npm.
       npm ERR! JSON.parse Tell the package author to fix their package.json file.
       npm ERR! 
       npm ERR! System Linux 2.6.32-343-ec2
       npm ERR! command "/tmp/node-node-c3iD/bin/node" "/tmp/node-npm-E95q/cli.js" "install" "--production"
       npm ERR! cwd /tmp/build_17bicinzz6vv0
       npm ERR! node -v v0.4.7
       npm ERR! npm -v 1.0.106
       npm ERR! file /tmp/build_17bicinzz6vv0/package.json
       npm ERR! code EJSONPARSE
       npm ERR! 
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_17bicinzz6vv0/npm-debug.log
       npm not ok
 !     Failed to install --production dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

My package.json is:

{
  "name": "node-example",
  "version": "0.0.1",
  "dependencies": {
    "express": "2.2.0"
  }
}

There's absolutely nothing wrong with my JSON, which I got from their tutorial, because when I run it locally, it works great. Why am I getting this error?

2
  • 4
    Looks perfectly valid and validates for me - are you sure you've commited any changes to the file and pushed to git so that the correct file is being pushed to Heroku? Commented Apr 16, 2012 at 6:28
  • I committed and pushed all of my changes but it still wouldn't work. I simply started over with the same tutorial and everything worked. Don't know what I screwed up the first time but the second time it worked great. Commented Apr 16, 2012 at 21:19

3 Answers 3

1

I get the feeling this would have had the answer

 npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_17bicinzz6vv0/npm-debug.log
Sign up to request clarification or add additional context in comments.

Comments

1

Try adding the whole content in package.json as provided by Heroku tutorial.... I also got the same error, it was removed by adding engines.

`{
    "name": "app-name",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
      "express": "~2.5.8",
      "ejs": "~0.7.1",
      "socket.io": "~0.9.6"
  },
  "engines": {
    "node": "0.6.x"
  }
}`

Comments

0

try a newer version of Node.js

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.