Heroku构建失败,“致命:不是git存储库”

时间:2018-07-24 20:36:44

标签: node.js git github heroku deployment

我正在尝试将我的应用程序部署到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时,构建失败,因为找不到。

发生了什么事?

1 个答案:

答案 0 :(得分:0)

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

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