簡體   English   中英

Heroku應用程序不會部署解析錯誤:在第10行的第3列node.js上需要另一個鍵值對

[英]Heroku app won't deploy parse error: Expected another key-value pair at line 10, column 3 node.js

我不明白為什么我的應用無法部署! 與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"
  }
}

這是由於第10行末尾的逗號引起的。 根據此答案 ,不允許使用它們。 JSON解析器需要另一個'packagename': 'version'對,但是沒有。 解決方案很簡單:更改此:

"nib": "*",

至:

"nib": "*"

僅供參考,如果您尚未提交所有更改(尤其是對於package.json文件),則git push heroku master命令可能會收到此錯誤。 那是我的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM