Heroku应用程序不会部署解析错误:预计第10行第3列node.js处的另一个键值对

时间:2014-05-05 10:41:59

标签: node.js git heroku

我不明白为什么我的应用程序不会部署!是否与package.json文件有关?我错过了什么吗?任何帮助将不胜感激!我的终端出现以下错误:

Initializing repository, done.
Counting objects: 8405, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6078/6078), done.
Writing objects: 100% (8405/8405), 90.85 MiB | 726.00 KiB/s, done.
Total 8405 (delta 1988), reused 8183 (delta 1869)

-----> Removing .DS_Store files
-----> Node.js app detected
parse error: Expected another key-value pair at line 10, column 3

 !     Push rejected, failed to compile Node.js app

To git@heroku.com:stormy-brushlands-6191.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:stormy-brushlands-6191.git'

{
  "name": "MotionTherapy",
  "version": "0.0.1",
  "private": "true",
  "dependencies": {
    "express": "3.0.0alpha4",
    "jade": "*",
    "stylus": "*",
    "nib": "*",
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "Sophie-Plimbley",
  "license": "ISC",
  "engines": {
    "node": "0.10.x"
  },
  "repository": {
    "type": "git",
    "url": "git@heroku.com:stormy-brushlands-6191.git"
  }
}

2 个答案:

答案 0 :(得分:1)

这是由于第10行末尾的逗号。它们是不允许的,as per this answer。 JSON解析器需要另一个'packagename': 'version'对,但没有。解决方案很简单:改变这个:

"nib": "*",

要:

"nib": "*"

答案 1 :(得分:0)

如果您没有提交所有更改(特别是对您的package.json文件),那么您的git push heroku master命令可能会收到此错误。那是我的问题。