[英]I cannot deploy node.js to Heroku due to a mysterious error
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"
}
在推送到heroku之前,您是否重新提交了更改? 關於此問題的大多數答案是某處缺少或逗號引起的,我建議將代碼通過json解析器進行檢查,以確保您具有所有有效的json。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.