php – Composer Satis Repository似乎指的是源URL而不是dist URL
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php – Composer Satis Repository似乎指的是源URL而不是dist URL,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2393字,纯文字阅读大概需要4分钟。
内容图文
我有一个Satis服务器,具有基本的HTTP身份验证设置.
配置文件如下所示:
{
"name": "MySatisServer",
"homepage": "https:\/\/satis.example.co.uk",
"repositories": [
{
"type": "git",
"url": "git@github.com:Org\/Repo1.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo2.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo3.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo4.git"
}
],
"require-all": true,
"require-dependencies": true,
"require-dev-dependencies": true,
"archive": {
"directory": "dist",
"format": "zip",
"prefix-url": "https://satis.example.co.uk"
}
}
我运行了satisf build,它使用看起来正确的packages.json文件创建了我的dist目录.
我可以在我的浏览器中访问https://satis.example.co.uk并下载我想要的任何版本的存储库作为ZIP,它工作正常.
当我尝试通过composer使用repo时出现问题.
我的composer.json文件看起来像这样:
{
"name": "some/project",
"description": "",
"license": "proprietary",
"authors": [],
"require": {
"org/repo-4": "^1.0"
},
"repositories": [
{
"type": "composer",
"url": "https://satis.example.co.uk"
}
]
}
由于Satis服务器支持基本的HTTP身份验证,因此我还有一个auth.json文件,如下所示:
{
"http-basic": {
"satis.example.co.uk": {
"username": "my-username",
"password": "my-password"
}
}
}
运行composer install会给我以下输出:
- Installing org/repo-4 (1.0.0): Downloading (failed) Failed to download org/repo-4 from dist: The "https://api.github.com/repos/Org/Repo4/zipball/128f63b6a91cf71d5cda8f84861254452ff3a1af" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Installing org/repo-4 (1.0.0): Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+box359.localdomain+2017-04-18+1416
to retrieve a token. It will be stored in "/home/ubuntu/CashbackEngine/auth.json" for future use by Composer.
Token (hidden):
正如您从上面所看到的,它完全忽略了需要下载的文件位于https://satis.example.co.uk/dist/org/repo-4/repo-4-1.0的事实. 0-e1cd03.zip,并且直接尝试从GitHub上的源代码获取,这不是理想的结果,因为它是一个私有的GitHub存储库.
它看起来好像甚至没有意识到有不同的dist版本可用.
我的设置有问题吗?
任何帮助表示赞赏.
解决方法:
该问题与composer.lock文件有关.
尽管Satis上的dist URL是正确的,但作曲家甚至没有注意它,因为作曲家锁定文件缓存了GitHub上的旧的dist url.
解决方案是删除composer.lock文件并运行composer install.我还预先运行了一个作曲家clearcache来确保.
内容总结
以上是互联网集市为您收集整理的php – Composer Satis Repository似乎指的是源URL而不是dist URL全部内容,希望文章能够帮你解决php – Composer Satis Repository似乎指的是源URL而不是dist URL所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。