Cyfrin / foundry-full-course-cu

GNU General Public License v3.0
3.4k stars 831 forks source link

error with installing chainlink-brownie-contracts #1379

Closed HussamX98 closed 4 months ago

HussamX98 commented 8 months ago

so I've been trying to run the $ forge install smartcontractkit/chainlink-brownie-contracts@0.6.1 --no-commit however for some reason it is returning this: Installing chainlink-brownie-contracts in C:/Users/alsal/foundry-simple-storage-f23/foundry-fund-me-f23/foundry-smart-contract-lottery-f23/foundry-erc20-f23/foundry-nft-f23/foundry-defi-stablecoin-f23/lib\chainlink-brownie-contracts (url: Some("https://github.com/smartcontractkit/chainlink-brownie-contracts"), tag: Some("0.6.1")) Cloning into 'C:/Users/alsal/foundry-simple-storage-f23/foundry-fund-me-f23/foundry-smart-contract-lottery-f23/foundry-erc20-f23/foundry-nft-f23/foundry-defi-stablecoin-f23/lib/chainlink-brownie-contracts'... remote: Enumerating objects: 32923, done. remote: Counting objects: 100% (2524/2524), done. remote: Compressing objects: 100% (1050/1050), done. remote: Total 32923 (delta 1447), reused 2336 (delta 1271), pack-reused 30399 Receiving objects: 100% (32923/32923), 46.85 MiB | 10.10 MiB/s, done. Resolving deltas: 100% (8658/8658), done. fatal: cannot write keep file 'C:/Users/alsal/foundry-simple-storage-f23/foundry-fund-me-f23/foundry-smart-contract-lottery-f23/foundry-erc20-f23/foundry-nft-f23/foundry-defi-stablecoin-f23/.git/modules/lib/chainlink-brownie-contracts/objects/pack/pack-138a398f0250df91bd09a3a22ad26265178d1cfd.keep': Filename too longfatal: fetch-pack: invalid index-pack output fatal: clone of 'https://github.com/smartcontractkit/chainlink-brownie-contracts' into submodule path 'C:/Users/alsal/foundry-simple-storage-f23/foundry-fund-me-f23/foundry-smart-contract-lottery-f23/foundry-erc20-f23/foundry-nft-f23/foundry-defi-stablecoin-f23/lib/chainlink-brownie-contracts' failed Error: git submodule exited with code 128 I've tried using git init, restarting computer, shutting down vscode but nothing worked does anyone know how to fix this issue?

Originally posted by @HussamX98 in https://github.com/Cyfrin/foundry-full-course-f23/discussions/1368

cryptjohel commented 6 months ago

now to solve this issue you have to use ``` forge install --no-git smartcontractkit/chainlink-brownie-contracts@0.8.0

after doing this try redoing it because of the internet connection. So it will then work perfectly 

forge install: Initiates the installation of dependencies. --no-git: Specifies that the dependency should be installed without adding it as a Git submodule. This means the dependency will be downloaded and included in your project directly, rather than as a Git submodule. smartcontractkit/chainlink-brownie-contracts: The GitHub repository or URL of the dependency you want to install. @0.8.0: The version or commit reference of the dependency you want to install. In this case, version 0.8.0 is specified. The --no-git option is particularly useful when you want to include the code of a dependency in your project directly without maintaining it as a Git submodule. Git submodules are separate Git repositories within your main repository, and they are often used to track external dependencies.

Using --no-git allows you to treat the dependency as part of your project's source code, and you won't need to separately manage it as a submodule. This can be beneficial when you don't need the advanced submodule features and prefer a simpler inclusion of the dependency's code in your project.

cryptjohel commented 6 months ago

I use --no-git so to not install them as a submodule so it actually worked trying it for about 3 times and it worked perfectly due to network issues. Which means sometime network can actually cause a lot regarding installation of some dependencies

On Sat, Mar 9, 2024, 9:37 PM loutcoin @.***> wrote:

Hi there, I had the same problem and none of the mentioned advice worked. What did work however, was first, creating a GitHub account, and generating an SSH key from the terminal in your coding software with your associated email. Once generated, enter the following command (if using WSL) into your terminal to copy the public key to your clipboard: clip.exe < ~/.ssh/id_ed25519.pub You should then go into settings on GitHub, click on "New SSH key" and paste the contents of the public key into the key field. From there you can test your authentication with the following command in your terminal: ssh -T @. If done correctly you should receive a message that you've "successfully authenticated but GitHub does not provide Shell access." You can then use the SSH URL to complete the process instead of the HTTPS URL for obtaining the files. Within your terminal, enter the following command: git clone @. :smartcontractkit/chainlink-brownie-contracts.git Worked for me, hope it works for you, best of luck in your coding endeavors.

— Reply to this email directly, view it on GitHub https://github.com/Cyfrin/foundry-full-course-f23/issues/1379#issuecomment-1986970419, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEHRX5QJJCRKZIINCR7NYVLYXNXIHAVCNFSM6AAAAABCZBMECOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWHE3TANBRHE . You are receiving this because you commented.Message ID: @.***>

Chujimafa commented 6 months ago

they have now neu, 0.8.0

snowieoxs commented 5 months ago

I also could not get the exact command from the video to work, but using the full url worked for me:

forge install https://github.com/smartcontractkit/chainlink-brownie-contracts@0.8.0 --no-commit
matheusluciano99 commented 4 months ago

use this "git config --system core.longpaths true" before running the command you were trying

PatrickAlphaC commented 4 months ago

Going to close this, sorry on our delay. Let us know if you're still having issues.