gpt4 book ai didi

git - 在 Heroku 上使用带有 npm 和 Node 的 Git 依赖项

转载 作者:IT老高 更新时间:2023-10-28 21:58:29 26 4
gpt4 key购买 nike

我有这个 package.json 文件:

{
"name": "application-name"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"coffee-script": "1.1.3"
, "express": "2.5.0"
, "less": "1.1.5"
, "jade": "0.17.0"
, "connect-redis": "1.2.0"
, "hiredis": "0.1.13"
, "redis": "0.7.1"
, "bcrypt": "0.4.1"
, "promised-io": "0.3.0"
, "jugglingdb": "git://github.com/juggy/jugglingdb.git#master"
, "nodemailer": "0.2.3"
}
}

我想部署到 Heroku。它在本地使用 npm 版本 1.0.105 可以正常工作,但它在 Heroku 上阻塞(我也将那里的 npm 更新为 1.0.105):

   -----> Heroku receiving push
-----> Fetching custom build pack... done
-----> Node.js app detected
-----> Fetching Node.js binaries
-----> Vendoring node 0.4.7
-----> Installing dependencies with npm 1.0.105
npm ERR! git checkout master fatal: Not a git repository: '.'
npm ERR! Error: `git "checkout" "master"` failed with 128
npm ERR! at ChildProcess.<anonymous> (/tmp/node-npm-Jb2d/lib/utils/exec.js:49:20)
npm ERR! at ChildProcess.emit (events.js:67:17)
npm ERR! at ChildProcess.onexit (child_process.js:192:12)
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Linux 2.6.32-316-ec2
npm ERR! command "/tmp/node-node-C3jD/bin/node" "/tmp/node-npm-Jb2d/cli.js" "install"
npm ERR! cwd /tmp/build_2yzg7lk83o5m9
npm ERR! node -v v0.4.7
npm ERR! npm -v 1.0.105
npm ERR! git checkout master fatal: Not a git repository: '.'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_2yzg7lk83o5m9/npm-debug.log
npm not ok
! Failed to install dependencies with npm
! Heroku push rejected, failed to compile Node.js app

另外,我似乎没有找到访问/tmp 中该日志文件的方法。

任何人都成功地在 Heroku 上部署了 Git 依赖项(在 ruby​​ 方面工作正常:P)?

最佳答案

仅供引用,如果它在 GitHub 上,您只需指定 username/repository,npm 将完成剩下的工作。

{
"name": "application-name"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"coffee-script": "1.1.3"
, "express": "2.5.0"
, "less": "1.1.5"
, "jade": "0.17.0"
, "connect-redis": "1.2.0"
, "hiredis": "0.1.13"
, "redis": "0.7.1"
, "bcrypt": "0.4.1"
, "promised-io": "0.3.0"
, "jugglingdb": "juggy/jugglingdb"
, "nodemailer": "0.2.3"
}
}

或者

指定(git/git+ssh/git+http/git+https)之一://user@host/repo.git 网址

完全 documented

关于git - 在 Heroku 上使用带有 npm 和 Node 的 Git 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8243527/

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