【发布时间】:2019-04-11 16:07:26
【问题描述】:
我有一个开发环境 git repo,其中包含我应用程序的所有各种组件作为子模块,每个子模块都有自己的 docker 容器,将文件夹作为卷安装。
一些子模块也需要彼此,所以为了减少混淆,我只是将它们列在我的 package.json 中
{
"dependencies": {
//...
"myapp-common": "https://path-to-my-repo.git",
}
}
这很好用,除了,当我需要在我的 docker 中运行 yarn 时。当我使用node-sass 之类的工具时,会根据运行yarn 的操作系统安装不同的软件包。
我遇到的问题是当我运行yarn install 等时,我得到了这个错误:
root@ea69cb8f4e7f:/app# yarn
yarn install v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads https://path-to-my-repo.git
Directory: /app
Output:
fatal: Not a git repository: ../.git/modules/myapp
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
任何想法如何解决这个问题?
【问题讨论】: