smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.2k stars 491 forks source link

fix corrupted lockfile due to the NPM bug #4828. #189

Open mreitschuster opened 1 month ago

mreitschuster commented 1 month ago

Hi all! I tried using the newest version to learn how to use VRF 2.5. So i checked out and installed a fresh version with:

git clone https://github.com/smartcontractkit/hardhat-starter-kit.git
cd hardhat-starter-kit
npm install
npx hardhat test

results in

Error HH18: You installed Hardhat with a corrupted lockfile due to the NPM bug #4828.
Please delete your node_modules, package-lock.json, reinstall your project, and try again.
For more info go to https://hardhat.org/HH18 or run Hardhat with --show-stack-traces

After some research it seems to me the package-lock.json should be generated by the npm install command, and not necessarily be part of the git source. Removing the package-lock.json and adding it to the .gitignore fixes the issue.