5

I'm getting a parse error when I do a git push heroku master. Heroku tells me which line and column is causing the parse error, but not which file. How do I find out which file heroku is having trouble parsing? Please advise.

----- package.json -----

{
  "name": "mean",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "mongoose": "3.8.7",
    "express": "3.4.8",
    "jade": "*",
    "stylus": "*"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.4.x"
  }
}

----- output -----

[23:46 56] git push heroku master
Initializing repository, done.
Counting objects: 259, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (242/242), done.
Writing objects: 100% (259/259), 927.54 KiB | 550.00 KiB/s, done.
Total 259 (delta 13), reused 0 (delta 0)

-----> Node.js app detected
parse error: Expected separator between values at line 13, column 16

 !     Push rejected, failed to compile Node.js app

To [email protected]:mighty-mountain-5447.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:mighty-mountain-5447.git'
2
  • Run jshint (preferably with grunt) before committing. It should tell you if there's anything that needs to be fixed with your js. Commented Feb 23, 2014 at 9:03
  • I am using jshint. Looks fine. That's why this is so baffling. I wish they would just say which file it is having trouble with. Commented Mar 1, 2014 at 19:02

3 Answers 3

8

Happened to me too, it was the comma I missed in the .json file.

You probably didn't put that comma in line 13 right away, and you commited

  },

Commit again and then push to Heroku.

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

3 Comments

My package.json is shown above. I see no missing commas in it. Do you?
There are several answers. Commit again helped! :)
Yes, I found my missed comma, but then forgot to commit it.
7

I just got the same exact error. In my case the problem was in the package.json file because I missed the comma after I manually added "engines" to it:

{
    "engines": {
        "node": "0.10.x"
    },  <-- missed this comma here

    "name": "heroku",...

2 Comments

My package.json is shown above. I see no missing commas in it. Do you?
surely not... Can you post your js file?
2

What's occurred is you've committed your code to git with an error a missing colon/comma. You need to git commit -a before running git push heroku master in order to get your fix into the code being pushed to heroku.

1 Comment

thank you so much.. After going through a lot of answer on stackoverflow i updated my package.json and forgot to commit that to git.. your answer helped me..Thank you

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.