node.js - Heroku 构建失败,“致命:不是 git 存储库”
问题描述
我正在尝试将我的应用程序部署到 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 时,构建失败,因为它没有找到。
发生了什么?
解决方案
两件事 - 你需要从你的 package.json 文件中删除 prepare 行(应该是引用 npm-merge-driver 的行,
并且您需要确保在运行 npm run deploy 之前添加、提交和推送代码 - 应该清除所有内容
推荐阅读
- rust - 如何清除kiss3d中的场景?
- php - 在 CodeIgniter 的 Controller 中为同一个函数设置多条路由
- c# - SSIS 2012 - 第二次执行脚本时变量为空
- r - R data.table 使用完整数据集对选择行执行聚合
- java - com.sun.xml.internal.ws.client.ClientTransportException:HTTP 传输错误:java.net.SocketException:连接重置
- python - 在 tf.while 得到 ValueError 时使用 rnn_cell:这两个结构没有相同数量的元素
- android - 用于 React Native 的 OpenID Connect 混合流程
- javascript - 如何根据字符串对对象进行排序
- selenium-webdriver - @AfterStep/@BeforeStep 不适用于 Cucumber Selenium Java
- c++ - 使用时出现向量库错误