Jul*_*ien 30 git heroku node.js npm
我有这个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"
}
}
Run Code Online (Sandbox Code Playgroud)
我想部署到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
Run Code Online (Sandbox Code Playgroud)
此外,我似乎没有找到一种方法来访问/ tmp中的该日志文件.
任何人都成功在Heroku上部署Git依赖(在ruby方面工作正常:P)?
cod*_*nja 78
仅供参考,如果它在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"
}
}
Run Code Online (Sandbox Code Playgroud)
指定(git/ git+ssh/ git+http/ git+https)://user@host/repo.giturl之一
完整记录
Der*_*ner 36
我不知道这个包,但我有其他人使用如下语法.在heroku上,使用对tar.gz的http引用
的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": "https://github.com/juggy/jugglingdb/tarball/master"
, "nodemailer": "0.2.3"
}
}
Run Code Online (Sandbox Code Playgroud)
Chr*_*man 12
问题出在他们的nodejs buildpack中.我已经向Heroku发送了一个拉取请求,但是我不知道他们是否或何时会做出回应.幸运的是,有一个使用自定义buildpack的文档记录不太完整,这将允许您解决该问题.我已经分叉了heroku的nodejs buildpack并修复了问题 - 可在此处获得:
https://github.com/chrisleishman/heroku-buildpack-nodejs/tree/git_fix
要使用它,你最好创建自己的https://github.com/heroku/heroku-buildpack-nodejs的github分支,然后在我的chrisleishman/git_fix分支中合并.例如(分叉后):
git clone git@github.com:@YOUR-GITHUB-NAME@/heroku-buildpack-nodejs.git
cd heroku-buildpack-nodejs
git remote add chrisleishman git://github.com/chrisleishman/heroku-buildpack-nodejs.git
git fetch chrisleishman
git merge chrisleishman/git_fix
git push
Run Code Online (Sandbox Code Playgroud)
然后,您可以将BUILDPACK_URLconfig变量添加到heroku应用程序中.例如
heroku config:add BUILDPACK_URL="git://github.com/@YOUR-GITHUB-NAME@/heroku-buildpack-nodejs.git
Run Code Online (Sandbox Code Playgroud)
然后下一次推送到heroku应该使用包含修复的自定义buildpack.