當我嘗試推送到 Heroku 時出現決議錯誤。Heroku 確切地告訴我錯誤的原因是什么,但我找不到問題所在...如何修復 package.json 檔案以克服此錯誤。先感謝您。
在“git push heroku master”之后
Enumerating objects: 128, done.
Counting objects: 100% (128/128), done.
Delta compression using up to 8 threads
Compressing objects: 100% (111/111), done.
Writing objects: 100% (128/128), 162.25 KiB | 8.54 MiB/s, done.
Total 128 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. heroku/nodejs
remote: 2. heroku/ruby
remote: -----> Node.js app detected
remote: parse error: Expected separator between values at line 15, column 19
remote: ! Unable to parse package.json
remote:
remote:
remote: -----> Build failed
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: !
remote: ! ## Warning - The same version of this code has already been built: b3c6397d182444e7dcae0a097773f19a122763b1
remote: !
remote: ! We have detected that you have triggered a build from source code with version b3c6397d182444e7dcae0a097773f19a122763b1
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to t-bear0513.
remote:
To https://git.heroku.com/t-bear0513.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/t-bear0513.git'
{ “名稱”:“heroku_deploy_app”,“私有”:true,“依賴項”:{ “@rails/actioncable”:“^6.0.0”,“@rails/activestorage”:“^6.0.0”,“@ rails/ujs": "^6.0.0", "@rails/webpacker": "4.3.0", "turbolinks": "^5.2.0" }, "version": "0.1.0", "engines" :{“節點”:“14.16.1”},“devDependencies”:{“webpack-dev-server”:“^4.8.1”},}
uj5u.com熱心網友回復:
嘗試更改您正在使用的節點版本,如下所示:
"engines": {
"node": "14.x"
},
還要確保它與您在本地使用的版本匹配
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/468967.html