Cyfrin/foundry-full-course-cu

error with installing chainlink-brownie-contracts

Closed this issue · 7 comments

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 #1368

try to reinstall git
or you don't have access to this dic from terminal

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.

they have now neu, 0.8.0

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

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

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