我有这个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可以正常工作)?
问题出在他们的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分支中。例如(分叉后):
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
然后,您可以将BUILDPACK_URLconfig变量添加到您的heroku应用中。例如
BUILDPACK_URL
heroku config:add BUILDPACK_URL="git://github.com/@YOUR-GITHUB-NAME@/heroku-buildpack-nodejs.git
然后,对heroku的下一次推送应使用包含修复程序的自定义buildpack。