gpt4 book ai didi

git - 推送被拒绝,无法编译 Node.js 应用程序 heroku

转载 作者:IT老高 更新时间:2023-10-28 23:14:19 25 4
gpt4 key购买 nike

当我尝试使用 git push heroku master 将我的 nodejs 应用程序推送到 heroku 时,我得到了这个:

Counting objects: 975, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (862/862), done.
Writing objects: 100% (975/975), 3.74 MiB | 80.00 KiB/s, done.
Total 975 (delta 70), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.10.15
Using npm version: 1.3.3
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm ERR! install Couldn't read dependencies
! Push rejected, failed to compile Node.js app

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

这是我的 package.json:

{
"name": "fnBoard",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node server.js"
},

"dependencies": {
"socket.io": "0.9.x"
},
"engines": {
"node": "0.10.x",
"npm": "1.3.x"
}
}

里面有一堆错误,我不知道为什么会这样。请帮忙。 -谢谢

最佳答案

我在 ReactJS 工作,我正在尝试在 Heroku 服务器上部署我的项目。当时我发现同样的错误是这样的:

Push rejected, failed to compile Node.js app.

enter image description here

解决办法是:

如果你使用 yarn :

git rm yarn.lock

git push heroku master

如果你使用 npm:

git rm package-lock.json

git push heroku master

关于git - 推送被拒绝,无法编译 Node.js 应用程序 heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18660474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com