git push heroku master失败,解析错误 - 哪个文件?

时间:2014-02-23 08:38:59

标签: node.js git heroku

当我做一个git push heroku master时,我得到一个解析错误。 Heroku告诉我哪个行和列导致解析错误,但不是哪个文件。如何找出heroku解析时遇到问题的文件?请指教。

----- 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'

3 个答案:

答案 0 :(得分:7)

也发生在我身上,这是我在.json文件中遗漏的逗号。

你可能没有马上把这个逗号放在第13行,你提交了

  },

再次提交,然后推送到Heroku。

答案 1 :(得分:6)

我得到了同样的错误。在我的情况下,问题出现在package.json文件中,因为我在手动添加“引擎”后错过了逗号:

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

    "name": "heroku",...

答案 2 :(得分:2)

发生了什么?您已将代码提交给git,并显示错误冒号/逗号。在运行git commit -a之前,您需要git push heroku master才能修复被推送到heroku的代码。

相关问题