Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push heroku master fails with parse error - which file?

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'
like image 383
RBR Avatar asked Feb 23 '14 08:02

RBR


People also ask

Why heroku push fail?

Reason: It maybe that your github default branch is main and not master or vice versa. So to solve this problem you will have to use your actual github default branch. In my case, I got the error because my github default branch isn't master but main .


2 Answers

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.

like image 158
user3123165 Avatar answered Oct 01 '22 01:10

user3123165


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",...
like image 37
Nikola Avatar answered Oct 01 '22 00:10

Nikola