Rretzko's avatar
Level 15

Filamentphp Install

Hi - I'm trying to install Filamentphp on a fresh Laravel 11 application (composer require filament/filament:"^3.2.57" -W) and am running into this error:

Could not fetch https://api.github.com/repos/filamentphp/forms/zipball/4f65d7a75809501a..., please review your configured GitHub OAuth token or enter a new one to access private repos
When working with _public_ GitHub repositories only, head here to retrieve a token:
https://github.com/settings/tokens/new?scopes=&description=Composer+on+DESKTOP-3T...+2024-05-06+1635
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to:
https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+DESKTOP-3T...+2024-05-06+1635
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "C:/Users/rick/AppData/Roaming/Composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth

I've created a dozen public and private tokens so far with no end in sight. Is there something I'm doing wrong or should be doing differently? Thanks!

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like you are encountering issues with GitHub OAuth tokens while trying to install a package using Composer. Here are a few steps you can follow to resolve this issue:

  1. Verify Token Scope: Ensure that the token you are using has the correct permissions. For public repositories, the token should have the public_repo scope. For private repositories, it should include repo. You can check and modify the scopes of your existing tokens in your GitHub settings.

  2. Correctly Set Up Token in Composer:

    • First, make sure that your token is correctly set in Composer's configuration. You can manually add your GitHub token to Composer's auth.json file. Here’s how you can do it:
      composer config -g github-oauth.github.com <YOUR_GITHUB_TOKEN>
      
    • Replace <YOUR_GITHUB_TOKEN> with your actual token.
  3. Check for Typos or Copy Errors: Sometimes, errors in copying the token might lead to such issues. Double-check the token you have entered.

  4. Clear Composer Cache: Sometimes, clearing the Composer cache can resolve fetching issues:

    composer clear-cache
    
  5. Retry Installation: After setting up the token and clearing the cache, try installing the package again:

    composer require filament/filament:"^3.2.57" -W
    
  6. Check GitHub API Rate Limits: If you are still having issues, you might be hitting GitHub's API rate limits. You can check your rate limit status using:

    curl -H "Authorization: token YOUR_GITHUB_TOKEN" https://api.github.com/rate_limit
    
  7. Use a Different Network: Sometimes, network issues or firewalls might block requests to GitHub. Try using a different network or a VPN.

If you follow these steps and still face issues, it might be helpful to check the Composer and GitHub documentation or seek further assistance from their support channels.

Rretzko's avatar
Rretzko
OP
Best Answer
Level 15

@LaryAI Adding this in case it helps someone else: I CTRL-C'd out of the loop and the filamentphp install seems to have successfully concluded.

Please or to participate in this conversation.