Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some corrupted lockfile #272

Closed
bijianing97 opened this issue Oct 24, 2022 · 3 comments
Closed

Some corrupted lockfile #272

bijianing97 opened this issue Oct 24, 2022 · 3 comments

Comments

@bijianing97
Copy link

Sometime I use the vscode and hardhat solidity I get following error
image

How can I solve it?
vscode version 1.72.2
hardhat solidity 0.5.5

@kanej
Copy link
Member

kanej commented Oct 24, 2022

Hey @bijianing97,

This is an issue with hardhat. If you run npx hardhat compile at the command line for this project you will see the error more clearly.

It is happening because of a dependency of hardhat that is platform specific. In your lockfile (package-lock.json for npm) you have a different platform version of the dependency that will run on your platform (maybe your running on mac, but the dep was checked in on windows).

This is a known issue, the workaround is:

  1. Delete your lockfile (package-lock.json for npm)
  2. Delete your node_modules folder
  3. Reinstall with npm install

@bijianing97
Copy link
Author

Thanks sir, now I can code with it correctly.

@kanej kanej closed this as completed Oct 31, 2022
@alcuadrado
Copy link
Member

For the record: npm/cli#4828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants