C:\Users\Archie Jugdersuren\summaproject_trial3 - Copy 6 - heroku2>git push
heroku master
Counting objects: 3247, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3049/3049), done.
Writing objects: 100% (3247/3247), 3.88 MiB | 496.00 KiB/s, done.
Total 3247 (delta 811), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: parse error: Expected another key-value pair at line 20, column 3
remote: ! Unable to parse package.json
remote:
remote:
remote: -----> Build failed
remote: parse error: Expected another key-value pair at line 20, column 3
remote: parse error: Expected another key-value pair at line 20, column 3
remote:
remote: We're sorry this build is failing! You can troubleshoot
common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-
deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to summ2.
remote:
To https://git.heroku.com/summ2.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/summ2.git'
我已经尝试了一切。这是第20行第3列的奇怪部分,它没有任何问题!我甚至摆脱了原来的行,看看错误是否仍然存在并且确实存在。另外,我摆脱了整个package.json文件,即使package.json为空,它仍然指向第20行第3列。我已经卸载并重新安装了Heroku并且没有运气......我已经加倍检查了我的依赖项
这是package.json:
{
"name": "hello world",
"version": "0.0.0",
"engines": {
"node": "6.11.0"
},
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "1.17.2",
"cheerio": "1.0.0-rc.2",
"cookie-parser": "1.4.3",
"debug": "2.6.3",
"ejs": "2.5.6",
"express": "4.15.2",
"google": "2.1.0",
"jquery": "3.2.1",
"morgan": "1.8.1",
"request": "2.81.0",
"serve-favicon": "~2.4.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Mongols/Deploy-Node-To-Heroku.git"
},
"keywords": [
"node",
"heroku",
"express"
],
"license": "MIT"
}
答案 0 :(得分:2)
在推送到heroku之前,您是否重新提交了更改?关于这个问题的大多数答案是某个地方缺少或额外逗号的结果,我建议通过json解析器放置代码并检查以确保你拥有所有有效的json。