Answer the question
In order to leave comments, you need to log in
How to "feed" a github token for a private repository?
Hello.
There is a private repository under my contribution, in one project I created a token with default settings without any problems, fed it with composer update, and forgot about it. Today it was necessary to do the same, but with the second repository, but it does not accept the previous token, it asks to create a new one, I was surprised, but I created it (later I tried to tick all the boxes when creating the token - this did not help the case).
In the end, he writes this:
Resolving dependencies through SAT
Dependency resolution completed in 46.814 seconds
Analyzed 9248 packages to resolve dependencies
Analyzed 244105 rules to resolve dependencies
- Installing <vendor>/<package_name> (dev-master <hash>)
Downloading https://api.github.com/repos/<vendor>/<package_name>/zipball/<hash>
Downloading: 100%
Could not fetch https://codeload.github.com/<vendor>/<package_name>/zipball/<hash>/legacy.zip/<hash>?access_token=<токен_который_работает_в_первом_проекте>, please create a GitHub OAuth token to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=<desc>
to retrieve a token. It will be stored in "/var/www/<project_name>/auth.json" for future use by Composer.
Token (hidden):
Token (hidden):
No token given, aborting.
You can also add it manually later by using "composer config github-oauth.github.com <token>"
Failed: [RuntimeException] 0: Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:
Failed to download gdmforex/internal-api-client from dist: Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:
Now trying to download from source
- Installing <vendor>/<package_name> (dev-master <hash>)
[RuntimeException]
Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:
Answer the question
In order to leave comments, you need to log in
Apparently, the problem is in one of the latest composer updates - after sudo composer self-update -r
that everything works like clockwork.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question