问题
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 git@heroku.com:mighty-mountain-5447.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:mighty-mountain-5447.git'
回答1:
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.
回答2:
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",...
回答3:
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.
来源:https://stackoverflow.com/questions/21966019/git-push-heroku-master-fails-with-parse-error-which-file