【问题标题】:Heroku build failing, 'fatal: Not a git repository'Heroku 构建失败,“致命:不是 git 存储库”
【发布时间】:2019-01-01 13:54:12
【问题描述】:

我正在尝试将我的应用部署到 Heroku,但不断收到错误消息

fatal: Not a git repository (or any parent up to mount point /tmp) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'

在我输入的命令下

$ git branch 
    -> master

$ git add -A

$ git commit -m'commit'
    ...your branch is up to date

$ git push

    everything-up-to-date

$ heroku create drumbo

    Creating ⬢ drumbo... done
    https://drumbo.herokuapp.com/ | https://git.heroku.com/drumbo.git

$ heroku buildpacks:set heroku/nodejs

    Buildpack set. Next release on sampleapp will use heroku/nodejs.
    Run git push heroku master to create a new release using this buildpack.

$ git init (added this in because of https://stackoverflow.com/questions/16853624/git-discovery-across-filesystem-not-set)

    Reinitialized existing Git repository in /Users/Berta/Desktop/Codes-senior/sampleapp/.git/

$ git push heroku master

    ...(fails with) - fatal: Not a git repository (or any parent up to mount parent /home/kozi) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

$ git status 

    On branch master
    your branch is up to date with 'origin/master'.
    nothing to commit, working tree clean

$ ls -A 

    ... .git, .github ...

终端日志中也有大量关于 npm-merge-driver 的废话。看起来构建在 npm install npm-merge-driver 被调用后立即失败-

> drumbo@1.0.0 prepare /tmp/build_77f785ef804afd5c02fbe1c7b6f209fd
remote:        > npm-merge-driver install
remote:
remote:        fatal: Not a git repository (or any parent up to mount 
point /tmp)
remote:        Stopping at filesystem boundary 
(GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote:        
/tmp/build_77f785ef804afd5c02fbe1c7b6f209fd/node_modules/npm-merge- 
driver/node_modules/yargs/yargs.js:1100

但是,当我卸载 npm-merge-driver 时,构建失败,因为它没有找到。

发生了什么事?

【问题讨论】:

    标签: node.js git github heroku deployment


    【解决方案1】:

    两件事 - 你需要从你的 package.json 文件中删除 prepare 行(应该是引用 npm-merge-driver 的行,

    并且您需要确保在运行 npm run deploy 之前添加、提交和推送代码 - 应该清除所有内容

    【讨论】:

    • 谢谢瑞克,这是你提到的第一件事。 Npm 合并驱动程序正在中断构建。曾尝试卸载npm-merge-driver,但还需要从包json中取出prepare行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-11
    • 2015-07-01
    • 1970-01-01
    • 2010-12-09
    • 1970-01-01
    相关资源
    最近更新 更多